:root {
  color-scheme: light;
  --canvas: #f2f3f1;
  --surface: #ffffff;
  --surface-soft: #f8f9f7;
  --sidebar: #222a2e;
  --sidebar-hover: #303a3e;
  --line: #e2e6e2;
  --line-strong: #d3d9d4;
  --text: #20272a;
  --muted: #707a7c;
  --muted-light: #aeb8ba;
  --accent: #6b5a92;
  --accent-hover: #59477f;
  --accent-soft: #f0edf5;
  --danger: #a64b50;
  --danger-soft: #fbf1f1;
  --green: #3d765b;
  --amber: #92713a;
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--text);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button:disabled {
  opacity: .55;
  cursor: wait;
}

.boot {
  padding: 28px;
  color: var(--accent);
  font-weight: 700;
}

.boot span {
  margin-inline-start: 10px;
  color: var(--muted);
  font-weight: 400;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 620px;
  padding: 22px 13px 14px;
  background: var(--sidebar);
  color: #edf0ed;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 10px 24px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #a999cc66;
  border-radius: 8px;
  color: #d5c9ed;
  font: 700 18px/1 Inter, "Segoe UI", sans-serif;
}

.brand b,
.brand small,
.signed b,
.signed small,
.login-brand b,
.login-brand small {
  display: block;
}

.brand b,
.login-brand b {
  font: 700 12px/1.3 Inter, "Segoe UI", sans-serif;
  letter-spacing: .06em;
}

.brand small,
.signed small {
  margin-top: 4px;
  color: var(--muted-light);
  font-size: 10px;
}

.sidebar nav {
  display: grid;
  gap: 16px;
}

.nav-group {
  display: grid;
  gap: 3px;
}

.nav-label {
  padding: 0 12px 5px;
  color: #849094;
  font-size: 10px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 37px;
  padding: 8px 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #bdc5c6;
  text-align: start;
  font-size: 12px;
  transition: background-color .15s, color .15s;
}

.nav-item:hover {
  background: #ffffff0b;
  color: #fff;
}

.nav-item.active {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-item.active::before {
  position: absolute;
  inset-block: 8px;
  inset-inline-start: 0;
  width: 2px;
  background: #b7a5dc;
  content: "";
}

.nav-dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 1px;
  background: #758184;
}

.nav-item.active .nav-dot {
  background: #c4b3e5;
}

.side-bottom {
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid #ffffff19;
}

.signed {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 5px 13px;
}

.signed b {
  max-width: 165px;
  overflow: hidden;
  color: #f0f2f0;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signed small {
  max-width: 165px;
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid #ffffff30;
  border-radius: 50%;
  background: #ffffff0d;
  color: #ded7ea;
  font-size: 12px;
  font-weight: 600;
}

.side-bottom .nav-item {
  min-height: 33px;
  font-size: 11px;
}

.main {
  min-width: 0;
}

.topbar {
  display: flex;
  min-height: 91px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px clamp(22px, 4vw, 58px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.topbar h1 {
  margin: 5px 0 0;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -.02em;
}

.eyebrow {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .035em;
}

.eyebrow span {
  padding-inline: 5px;
  color: #a8afb0;
}

.connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #56635e;
  font-size: 10px;
  white-space: nowrap;
}

.connection i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4e8768;
}

.content {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 29px clamp(22px, 4vw, 58px) 55px;
}

.dashboard-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 1px 0 25px;
}

.dashboard-intro h2 {
  margin: 6px 0 5px;
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -.025em;
}

.dashboard-intro p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.dashboard-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.stats-panel,
.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.stats-panel {
  margin-bottom: 21px;
}

.stats-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.stats-heading h2,
.panel-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}

.stats-heading span {
  color: var(--muted);
  font-size: 10px;
}

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

.stat-card {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 17px 16px 15px;
  border: 0;
  border-inline-start: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: start;
  transition: background .15s;
}

.stat-card:hover {
  background: var(--surface-soft);
}

.stat-card>span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-card strong {
  color: var(--text);
  font: 600 24px/1 Inter, "Segoe UI", sans-serif;
}

.stat-card small {
  color: var(--accent);
  font-size: 9px;
}

.activity-panel {
  margin-top: 0;
}

.panel.narrow {
  max-width: 680px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 19px;
  border-bottom: 1px solid var(--line);
}

.panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.primary,
.quiet,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 550;
  transition: background-color .15s, border-color .15s, color .15s;
}

.primary {
  min-height: 35px;
  padding: 0 13px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.quiet {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid transparent;
  background: transparent;
  color: #586366;
}

.quiet:hover {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--text);
}

.quiet.danger {
  color: var(--danger);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.check input {
  accent-color: var(--accent);
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  white-space: nowrap;
}

th {
  padding: 10px 17px;
  background: #fafbfa;
  color: #7a8383;
  font-size: 9px;
  font-weight: 600;
}

td {
  padding: 11px 17px;
  border-top: 1px solid #edf0ed;
  color: #566063;
  font-size: 10px;
}

td strong,
td small {
  display: block;
}

td strong {
  color: #293235;
  font-size: 11px;
  font-weight: 550;
}

td small {
  margin-top: 4px;
  color: #828b8c;
  font-size: 9px;
}

td code {
  color: #67568c;
  font: 10px Inter, "Segoe UI", sans-serif;
}

.actions {
  display: flex;
  justify-content: flex-start;
  gap: 3px;
}

.status {
  display: inline-flex;
  padding: 3px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: #687274;
  font-size: 9px;
}

.status.published {
  border-color: #c8ded0;
  background: #f3f8f4;
  color: var(--green);
}

.status.draft {
  border-color: #e6dcc5;
  background: #fbf8f0;
  color: var(--amber);
}

.status.warning {
  border-color: #fae1ad;
  background: #fffcf4;
  color: #b7791f;
}

.status.archived {
  border-color: #e2e6e2;
  background: #f8f9f7;
  color: #8a9292;
}

.empty-cell {
  padding: 34px 18px;
  color: var(--muted);
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #1b2428a8;
}

.editor {
  display: flex;
  width: min(930px, 100%);
  max-height: min(92vh, 920px);
  flex-direction: column;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 18px 55px #17212630;
}

.registrations-editor {
  width: min(1180px, 100%);
}

.registrations-content {
  min-height: 130px;
  overflow: auto;
  padding: 17px 20px;
}

.registrations-content>.muted,
.registrations-result>.muted {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 10px;
}

.registrations-result .table-wrap {
  max-height: 60vh;
}

.registrations-result table {
  min-width: 780px;
}

.registrations-result td a {
  color: var(--accent);
  text-decoration: none;
}

.registrations-result td a:hover {
  text-decoration: underline;
}

.registrations-result>.muted {
  margin-top: 12px;
}

.modal-head {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.modal-head h2 {
  margin: 4px 0 0;
  font-size: 16px;
}

.icon-btn {
  width: 31px;
  height: 31px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: #596365;
  font-size: 19px;
}

.icon-btn:hover {
  background: var(--surface-soft);
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  padding: 19px 20px;
}

.editor-grid label,
.form-stack label,
.login-card label {
  display: grid;
  gap: 6px;
  color: #4d585a;
  font-size: 10px;
}

.editor-grid input,
.editor-grid textarea,
.editor-grid select,
.form-stack input,
.login-card input {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  outline: 0;
  background: #fff;
  color: var(--text);
  font-size: 11px;
}

.editor-grid textarea {
  resize: vertical;
  line-height: 1.7;
}

.editor-grid input:focus,
.editor-grid textarea:focus,
.editor-grid select:focus,
.form-stack input:focus,
.login-card input:focus {
  border-color: #8977b2;
}

.editor-grid .field-check {
  align-self: end;
  min-height: 36px;
  display: flex;
  align-items: center;
}

.editor-grid .field-check-wrap {
  display: grid;
  align-content: end;
  gap: 4px;
}

.editor-grid .field-check-wrap>small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.image-field {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.image-field-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.image-field-controls small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.image-upload-button {
  position: relative;
  cursor: pointer;
}

.image-upload-button.uploading {
  pointer-events: none;
  opacity: .6;
}

.image-preview {
  width: 92px;
  height: 82px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  object-fit: cover;
}

.image-preview[hidden] {
  display: none;
}

.image-field-label {
  min-height: 16px;
}

.media-field {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.media-field>small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.drive-media-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 105px auto;
  gap: 7px;
}

.drive-media-controls input,
.drive-media-controls select,
.image-field-controls input[data-drive-cover-url] {
  min-width: 0;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-size: 10px;
}

.drive-media-controls input:focus,
.drive-media-controls select:focus,
.image-field-controls input[data-drive-cover-url]:focus {
  border-color: #8977b2;
  outline: 0;
}

.event-media-list {
  display: grid;
  gap: 6px;
}

.event-media-item {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
}

.event-media-item .quiet {
  min-height: 24px;
}

.image-crop-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #1b2428c9;
}

.image-crop-dialog {
  display: flex;
  width: min(720px, 100%);
  max-height: 94vh;
  flex-direction: column;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 22px 70px #11191dcc;
}

.image-crop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 19px;
  border-bottom: 1px solid var(--line);
}

.image-crop-head h2 {
  margin: 4px 0 0;
  font-size: 16px;
}

.image-crop-body {
  padding: 16px 19px;
}

.image-crop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.crop-ratios {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
}

.crop-ratios button {
  min-height: 29px;
  padding: 0 10px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #657071;
  font-size: 10px;
}

.crop-ratios button:hover {
  color: var(--text);
}

.crop-ratios button.selected {
  background: var(--accent);
  color: #fff;
}

.crop-stage {
  display: grid;
  min-height: 190px;
  place-items: center;
  margin: 15px 0;
  padding: 12px;
  overflow: hidden;
  border: 1px solid #302d38;
  border-radius: 5px;
  background: #18171c;
}

.crop-stage canvas {
  display: block;
  max-width: 100%;
  max-height: 43vh;
  border-radius: 2px;
  cursor: grab;
  touch-action: none;
}

.crop-stage canvas:active {
  cursor: grabbing;
}

.crop-controls {
  display: grid;
  gap: 9px;
}

.crop-controls label {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: #4d585a;
  font-size: 10px;
}

.crop-controls input[type="range"] {
  width: 100%;
  min-height: 22px;
  accent-color: var(--accent);
}

.crop-controls output {
  color: var(--accent);
  font-size: 10px;
}

.crop-controls p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.image-crop-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  padding: 12px 19px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.modal-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.notice {
  margin: 16px 18px;
  padding: 11px 13px;
  border: 1px solid #ddd6eb;
  border-radius: 4px;
  background: var(--accent-soft);
  color: #514866;
  font-size: 11px;
  line-height: 1.8;
}

.notice.error {
  border-color: #e8cccc;
  background: var(--danger-soft);
  color: #8f3e43;
}

.notice small {
  color: var(--muted);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 0;
  padding: 0 17px;
}

.media-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.media-item:nth-last-child(-n+1) {
  border-bottom: 0;
}

.media-item img,
.file-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  object-fit: cover;
}

.file-icon {
  color: var(--accent);
  font-size: 12px;
}

.media-item strong,
.media-item small {
  display: block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-item strong {
  color: var(--text);
  font-size: 10px;
}

.media-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.media-item .quiet {
  margin-top: 5px;
  font-size: 9px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 40px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.upload-button {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.form-stack {
  display: grid;
  gap: 15px;
  padding: 20px;
}

.form-stack small {
  color: var(--muted);
  font-size: 9px;
}

.form-stack button {
  justify-self: start;
}

.muted {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
}

.login-wrap {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
  background: #edf0ed;
}

.login-layout {
  display: grid;
  width: min(980px, 100%);
  min-height: 540px;
  grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #dce1dc;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 48px #1e2a2612;
}

.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 38px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
  color: var(--text);
  text-decoration: none;
}

.login-brand .brand-mark {
  border-color: #d8d0e5;
  color: var(--accent);
}

.login-brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.login-card h1 {
  margin: 7px 0 4px;
  font-size: 23px;
  font-weight: 650;
}

.login-card form {
  display: grid;
  gap: 14px;
  margin: 23px 0 14px;
}

.login-card input {
  min-height: 40px;
}

.full {
  width: 100%;
  min-height: 40px;
}

.login-card .notice {
  margin: 14px 0 0;
}

.login-aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 34px;
  background: #222a2e;
  color: #edf0ed;
}

.aside-kicker {
  color: #aeb8ba;
  font: 10px Inter, "Segoe UI", sans-serif;
  letter-spacing: .08em;
}

.login-aside p {
  margin: 0 0 10px;
  color: #c5c9c7;
  font-size: 12px;
}

.login-aside h2 {
  margin: 0 0 17px;
  font-size: clamp(27px, 4vw, 39px);
  font-weight: 600;
  line-height: 1.45;
}

.login-aside div>span {
  color: #b4bdbd;
  font-size: 11px;
  line-height: 1.9;
}

.aside-foot {
  padding-top: 15px;
  border-top: 1px solid #ffffff24;
  color: #9ea9a9;
  font-size: 9px;
}

.show {
  position: fixed;
  z-index: 20;
  inset-inline-end: 24px;
  bottom: 20px;
  padding: 10px 14px;
  border: 1px solid #c9c1d9;
  border-radius: 4px;
  background: #fff;
  color: #3f4650;
  font-size: 11px;
  box-shadow: 0 8px 24px #1721261c;
  opacity: 1;
  transform: translateY(0);
  transition: .2s;
}

.show.error {
  border-color: #e0bfc1;
  color: var(--danger);
}

#toast:not(.show) {
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
}

/* Loading State & Transitions */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
  padding: 40px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: adminSpin .65s linear infinite;
}

@keyframes adminSpin {
  to {
    transform: rotate(360deg);
  }
}

.content-fade {
  animation: adminFadeIn .16s ease-out;
}

@keyframes adminFadeIn {
  from {
    opacity: 0.6;
    transform: translateY(3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1150px) {
  .layout {
    grid-template-columns: 222px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 10px;
  }

  .content {
    padding-inline: 27px;
  }

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

  .stat-card:nth-child(4) {
    border-inline-start: 0;
  }

  .stat-card:nth-child(n+4) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .layout {
    display: block;
  }

  .sidebar {
    position: relative;
    height: auto;
    min-height: 0;
    padding: 10px 12px 8px;
    border-bottom: 1px solid #ffffff1c;
  }

  .brand {
    padding: 2px 6px 10px;
  }

  .brand-mark {
    width: 33px;
    height: 33px;
  }

  .sidebar nav {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding-bottom: 3px;
  }

  .nav-group {
    display: contents;
  }

  .nav-label {
    display: none;
  }

  .nav-item {
    flex: none;
    width: auto;
    min-height: 34px;
    padding: 7px 9px;
    font-size: 10px;
  }

  .nav-item.active::before {
    inset-block: auto 0;
    inset-inline: 9px;
    width: auto;
    height: 2px;
  }

  .nav-dot {
    display: none;
  }

  .side-bottom {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 6px;
    padding-top: 6px;
  }

  .signed {
    min-width: 0;
    margin-inline-end: auto;
    padding: 3px;
  }

  .signed small {
    max-width: 105px;
  }

  .side-bottom .nav-item {
    width: auto;
    padding-inline: 7px;
    font-size: 9px;
  }

  .topbar {
    min-height: 72px;
    padding: 12px 16px;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .connection {
    gap: 0;
    padding: 7px;
    font-size: 0;
  }

  .connection i {
    width: 7px;
    height: 7px;
  }

  .content {
    padding: 20px 13px 38px;
  }

  .dashboard-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
  }

  .dashboard-intro h2 {
    font-size: 20px;
  }

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

  .stat-card {
    padding: 13px 12px;
  }

  .stat-card:nth-child(odd) {
    border-inline-start: 0;
  }

  .stat-card:nth-child(even) {
    border-inline-start: 1px solid var(--line);
  }

  .stat-card:nth-child(n+3) {
    border-top: 1px solid var(--line);
  }

  .panel-head {
    padding: 13px;
  }

  .editor-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .editor-grid label:first-child {
    grid-column: auto;
  }

  .editor {
    max-height: 96vh;
  }

  .modal-backdrop {
    padding: 7px;
  }

  .image-crop-backdrop {
    padding: 7px;
  }

  .image-crop-dialog {
    max-height: 96vh;
  }

  .image-crop-head,
  .image-crop-body {
    padding-inline: 13px;
  }

  .crop-stage canvas {
    max-height: 38vh;
  }

  .crop-controls label {
    grid-template-columns: 85px minmax(0, 1fr);
  }

  .image-crop-actions {
    padding-inline: 13px;
  }

  .media-grid {
    grid-template-columns: 1fr;
    padding-inline: 13px;
  }

  .table-wrap table {
    min-width: 680px;
  }

  .panel.narrow {
    max-width: none;
  }

  .login-wrap {
    padding: 12px;
  }

  .login-layout {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .login-card {
    padding: 27px 23px;
  }

  .login-brand {
    margin-bottom: 34px;
  }

  .login-aside {
    display: none;
  }
}

/* Refined administration workspace */
:root {
  --canvas: #f4f5f8;
  --surface: #ffffff;
  --surface-soft: #f8f8fb;
  --sidebar: #171923;
  --sidebar-hover: #292a38;
  --line: #e7e8ee;
  --line-strong: #d9dbe5;
  --text: #252630;
  --muted: #747684;
  --muted-light: #a5a7b5;
  --accent: #6f58bd;
  --accent-hover: #5c46a5;
  --accent-soft: #f2effa;
  --danger: #a64b50;
  --danger-soft: #fbf1f1;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--canvas);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

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

.sidebar {
  z-index: 5;
  min-height: 100vh;
  padding: 23px 14px 15px;
  box-shadow: inset -1px 0 #ffffff0b;
}

.brand {
  gap: 12px;
  padding: 2px 9px 25px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: #ffffff08;
}

.brand b {
  font-size: 12px;
  letter-spacing: .075em;
}

.brand small {
  font-size: 10px;
}

.sidebar nav {
  min-height: 0;
  gap: 17px;
  overflow-y: auto;
  padding: 0 2px 8px;
  scrollbar-color: #ffffff20 transparent;
  scrollbar-width: thin;
}

.nav-group {
  gap: 4px;
}

.nav-label {
  padding: 0 11px 7px;
  color: #87899a;
  font-size: 10px;
  font-weight: 600;
}

.nav-item {
  min-height: 39px;
  gap: 12px;
  padding: 8px 11px;
  border-radius: 8px;
  color: #c0c2ce;
  font-size: 11px;
  transition: background-color .12s ease, color .12s ease;
}

.nav-item:hover {
  background: #ffffff0c;
  color: #fff;
}

.nav-item.active {
  background: #ffffff12;
  color: #fff;
}

.nav-item.active::before {
  inset-block: 8px;
  width: 3px;
  border-radius: 4px;
  background: #b6a4f3;
}

.nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #656879;
}

.nav-item.active .nav-dot {
  background: #c1b0fa;
  box-shadow: 0 0 0 3px #b7a4f31a;
}

.side-bottom {
  flex: none;
  padding-top: 12px;
  border-color: #ffffff18;
}

.signed {
  gap: 10px;
  padding: 8px 5px 12px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-color: #b8a8ec40;
  background: #b8a8ec18;
  color: #e2dafa;
}

.side-bottom .nav-item {
  min-height: 34px;
}

.main {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 4;
  top: 0;
  min-height: 86px;
  padding: 15px clamp(24px, 4vw, 60px);
  border-bottom-color: #e5e6ec;
  background: #ffffffed;
  backdrop-filter: blur(10px);
}

.topbar h1 {
  font-size: 22px;
  letter-spacing: -.025em;
}

.eyebrow {
  font-size: 10px;
}

.connection {
  border-color: #dce9df;
  border-radius: 99px;
  background: #f7fbf8;
  color: #456d50;
}

.connection i {
  box-shadow: 0 0 0 3px #4e87681a;
}

.content {
  width: min(100%, 1510px);
  padding: 31px clamp(24px, 4vw, 60px) 58px;
}

.dashboard-intro {
  margin-bottom: 23px;
}

.dashboard-intro h2 {
  font-size: 25px;
}

.dashboard-intro p:not(.eyebrow) {
  font-size: 12px;
}

.dashboard-actions {
  gap: 8px;
}

.stats-panel,
.panel {
  border-color: #e5e6ed;
  border-radius: 11px;
  box-shadow: 0 2px 7px #27283a05;
}

.stats-panel {
  margin-bottom: 19px;
}

.stats-heading {
  padding: 16px 19px 13px;
}

.stats-heading h2,
.panel-head h2 {
  font-size: 13px;
}

.stats {
  gap: 9px;
  padding: 13px;
}

.stat-card {
  min-height: 110px;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  transition: border-color .12s ease, background-color .12s ease;
}

.stat-card:hover {
  border-color: #cfc6e7;
  background: #fcfbff;
}

.stat-card>span {
  font-size: 10px;
}

.stat-card strong {
  font-size: 26px;
}

.stat-card small {
  font-size: 9px;
}

.panel-head {
  padding: 17px 19px;
}

.panel-head p {
  font-size: 10px;
}

.primary,
.quiet,
.icon-btn {
  border-radius: 7px;
  font-size: 11px;
}

.primary {
  min-height: 37px;
  padding-inline: 15px;
  box-shadow: 0 1px 2px #40336c12;
}

.quiet {
  min-height: 31px;
  padding-inline: 10px;
}

.toolbar {
  min-height: 45px;
  padding-inline: 18px;
}

th {
  padding: 12px 17px;
  background: #f8f8fb;
  font-size: 9px;
}

td {
  padding: 12px 17px;
  border-top-color: #eff0f4;
  font-size: 10px;
}

tbody tr {
  transition: background-color .12s ease;
}

tbody tr:hover {
  background: #faf9fd;
}

td strong {
  font-size: 11px;
}

.status {
  border-radius: 99px;
  padding: 4px 9px;
}

.empty-cell {
  padding-block: 42px;
}

.editor,
.image-crop-dialog {
  border-color: #e4e5ec;
  border-radius: 12px;
  box-shadow: 0 22px 70px #14152230;
}

.modal-head,
.image-crop-head {
  padding: 17px 20px;
}

.editor-grid {
  gap: 15px;
  padding: 20px;
}

.editor-grid input,
.editor-grid textarea,
.editor-grid select,
.form-stack input,
.login-card input {
  border-radius: 7px;
}

.editor-grid input:focus,
.editor-grid textarea:focus,
.editor-grid select:focus,
.form-stack input:focus,
.login-card input:focus {
  border-color: #9584c3;
  box-shadow: 0 0 0 3px #7159bd18;
}

.view-loading {
  display: flex;
  min-height: 230px;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
}

.loading-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.team-members-panel {
  overflow: hidden;
}

.team-accordion-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.team-accordion {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.team-accordion[open] {
  border-color: #d6d0e5;
  box-shadow: 0 2px 9px #33245b08;
}

.team-accordion>summary {
  display: flex;
  min-height: 67px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}

.team-accordion>summary::-webkit-details-marker {
  display: none;
}

.team-accordion>summary:hover {
  background: #fbfaff;
}

.team-group-heading {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.team-group-heading strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-group-heading small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-group-count {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.team-group-count b {
  display: grid;
  min-width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--text);
  font: 600 11px/1 Inter, "Segoe UI", sans-serif;
}

.team-group-count small {
  font-size: 9px;
}

.team-accordion-chevron {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  margin-inline-start: 4px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #777887;
  font: 14px/1 "Segoe UI", sans-serif;
  transition: transform .15s ease;
}

.team-accordion[open] .team-accordion-chevron {
  transform: rotate(180deg);
}

.team-accordion-body {
  border-top: 1px solid var(--line);
}

.team-accordion-body .table-wrap {
  padding: 0 5px 5px;
}

.team-accordion-body table {
  min-width: 800px;
}

.team-role-label {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 9px;
  border: 1px solid #ddd8eb;
  border-radius: 99px;
  background: #f7f5fb;
  color: #69568f;
  font-size: 9px;
}

.team-role-label.leader {
  border-color: #e4d7bd;
  background: #fbf7ed;
  color: #8b6b2f;
}

.team-group-empty,
.team-list-empty {
  padding: 25px 16px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #8d79c944;
  outline-offset: 2px;
}

@media (max-width: 1150px) {
  .layout {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .content {
    padding-inline: 27px;
  }
}

@media (max-width: 720px) {
  .sidebar {
    position: sticky;
    z-index: 6;
    height: auto;
    min-height: 0;
    padding: 10px 12px 8px;
  }

  .brand {
    padding: 2px 6px 10px;
  }

  .sidebar nav {
    gap: 4px;
  }

  .nav-item {
    min-height: 36px;
    border-radius: 7px;
  }

  .topbar {
    min-height: 70px;
    padding: 11px 16px;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .content {
    padding: 18px 13px 38px;
  }

  .dashboard-intro h2 {
    font-size: 21px;
  }

  .stats {
    gap: 7px;
    padding: 10px;
  }

  .stat-card {
    min-height: 98px;
    border: 1px solid var(--line) !important;
    border-radius: 8px;
  }

  .panel-head {
    gap: 10px;
  }

  .team-accordion-list {
    gap: 8px;
    padding: 10px;
  }

  .team-accordion>summary {
    min-height: 62px;
    gap: 9px;
    padding: 10px 11px;
  }

  .team-group-heading strong {
    font-size: 11px;
  }

  .team-group-heading small {
    max-width: 58vw;
    font-size: 9px;
  }
}

/* Educational Resources Management Styles */
.edu-course-thumb {
  width: 44px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.edu-thumb-placeholder {
  width: 44px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 10px;
  flex-shrink: 0;
}

.edu-course-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.edu-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 500;
  border: 1px solid var(--line);
}

.edu-badge.beginner {
  background: #f2f8f4;
  border-color: #cbe3d3;
  color: #3b7458;
}

.edu-badge.intermediate {
  background: #f0f5fa;
  border-color: #cbdded;
  color: #316594;
}

.edu-badge.advanced {
  background: #f6f2fb;
  border-color: #dfd3f3;
  color: #694ea1;
}

.edu-syllabus-editor {
  width: min(1060px, 98%);
}

.edu-syllabus-body {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: calc(85vh - 120px);
  overflow-y: auto;
}

.edu-course-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-soft);
  border-radius: 6px;
  border: 1px solid var(--line);
}

.edu-course-meta-bar h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}

.edu-course-meta-bar p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.edu-module-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.edu-module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fafbfa;
  border-bottom: 1px solid var(--line);
  gap: 10px;
}

.edu-module-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.edu-module-order {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
}

.edu-module-title {
  font-size: 12px;
  font-weight: 650;
  margin: 0;
}

.edu-module-desc {
  font-size: 10px;
  color: var(--muted);
  margin: 2px 0 0;
}

.edu-module-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.edu-lessons-list {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
}

.edu-lesson-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 5px;
  border: 1px solid #edf0ed;
  background: #fff;
  gap: 12px;
  transition: border-color .15s;
}

.edu-lesson-row:hover {
  border-color: var(--line-strong);
  background: #fafbfa;
}

.edu-lesson-lead {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.edu-lesson-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  flex-shrink: 0;
}

.edu-lesson-icon.text {
  background: #eef2f5;
  color: #486581;
}

.edu-lesson-details {
  min-width: 0;
}

.edu-lesson-name {
  font-size: 11px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.edu-lesson-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  font-size: 9px;
  color: var(--muted);
}

.edu-lesson-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.edu-resources-editor {
  width: min(720px, 95%);
}

.edu-resources-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.edu-res-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  gap: 12px;
}

.edu-res-item-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

.edu-res-item-sub {
  font-size: 9px;
  color: var(--muted);
  margin-top: 2px;
}

.edu-res-add-box {
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  padding: 14px;
  background: #fafbfa;
  margin-top: 6px;
}

.edu-res-add-box h4 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 650;
}

.edu-exam-questions-editor {
  width: min(960px, 98%);
}

.edu-q-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.edu-q-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.edu-q-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.edu-options-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.edu-opt-item {
  font-size: 10px;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #e7ebe7;
  background: var(--surface-soft);
}

.edu-opt-item.correct {
  border-color: #aed9be;
  background: #eef8f2;
  color: #22663e;
  font-weight: 600;
}

/* Educational hub tabs */
.edu-hub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.edu-hub-tab {
  flex: 1 1 auto;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.edu-hub-tab:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.edu-hub-tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

@media (max-width: 640px) {
  .edu-hub-tab {
    flex-basis: 100%;
  }
}

/* Educational hub layout fixes */
.edu-table {
  white-space: normal;
  table-layout: auto;
}

.edu-table th,
.edu-table td {
  padding-inline: 12px;
  vertical-align: middle;
}

.edu-table td strong {
  overflow-wrap: anywhere;
}

.edu-table td small code {
  overflow-wrap: anywhere;
}

.edu-table .actions {
  flex-wrap: wrap;
  min-width: 170px;
  max-width: 230px;
  gap: 4px;
}

.edu-table .actions .primary {
  flex: 1 1 100%;
}

.edu-course-cell>div {
  min-width: 0;
}

.edu-syllabus-body>*,
.edu-module-box,
.edu-module-head,
.edu-lessons-list,
.edu-lesson-row {
  flex-shrink: 0;
}

.edu-module-box {
  overflow: visible;
}

.edu-module-head {
  border-radius: 8px 8px 0 0;
  flex-wrap: wrap;
}

.edu-lessons-list {
  overflow: visible;
}

.edu-lesson-row {
  flex-wrap: wrap;
  min-height: 52px;
}

.edu-lesson-lead {
  flex: 1 1 260px;
}

.edu-lesson-name {
  white-space: normal;
}

.edu-lesson-meta-line {
  flex-wrap: wrap;
}

.edu-lesson-actions {
  flex-wrap: wrap;
}

.edu-syllabus-editor {
  max-height: 92vh;
}

.edu-syllabus-body {
  max-height: none;
  overflow: visible;
}

/* Image Cropper & Resizer Modal Styles */
.cropper-backdrop {
  z-index: 1000;
  background: rgba(10, 14, 18, 0.85);
  backdrop-filter: blur(4px);
}

.cropper-modal {
  width: min(860px, 96vw);
  max-height: 94vh;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  direction: rtl;
}

.cropper-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  gap: 12px;
}

.cropper-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cropper-header-title h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.supabase-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: rgba(62, 207, 142, 0.12);
  border: 1px solid rgba(62, 207, 142, 0.3);
  color: #2e9f6c;
  font-size: 10px;
  font-weight: 600;
  border-radius: 99px;
}

.cropper-body {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
  padding: 0;
  flex: 1;
  overflow: hidden;
  min-height: 440px;
}

@media (max-width: 768px) {
  .cropper-body {
    grid-template-columns: 1fr;
    max-height: 65vh;
    overflow-y: auto;
  }
}

.cropper-viewport-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #090c10;
  padding: 16px;
  position: relative;
  user-select: none;
}

.cropper-canvas {
  max-width: 100%;
  max-height: 380px;
  border-radius: 6px;
  cursor: grab;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.cropper-canvas.dragging {
  cursor: grabbing;
}

.cropper-hint {
  margin-top: 10px;
  font-size: 11px;
  color: #7a889b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cropper-sidebar {
  padding: 18px;
  background: var(--surface-soft);
  border-inline-start: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.cropper-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cropper-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cropper-presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.cropper-preset-btn {
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.cropper-preset-btn:hover {
  border-color: var(--accent);
  background: rgba(183, 169, 242, 0.1);
}

.cropper-preset-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.cropper-dimensions-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
}

.cropper-dim-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-family: monospace;
  text-align: center;
}

.cropper-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cropper-slider {
  flex: 1;
  accent-color: var(--accent);
}

.cropper-tool-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.cropper-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s;
}

.cropper-tool-btn:hover {
  background: var(--surface-soft);
}

.cropper-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  gap: 10px;
}

.cropper-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-supabase-upload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: linear-gradient(135deg, #2e9f6c 0%, #1e7e52 100%);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(46, 159, 108, 0.25);
  transition: transform 0.1s, box-shadow 0.15s;
}

.btn-supabase-upload:hover {
  box-shadow: 0 6px 16px rgba(46, 159, 108, 0.35);
  transform: translateY(-1px);
}

.btn-supabase-upload:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ========================================================
   Mobile & Small-Screen Responsive Enhancements
   (Desktop > 768px remains 100% unchanged)
   ======================================================== */
.sidebar-backdrop,
.mobile-menu-btn,
.mobile-close-btn {
  display: none;
}

.topbar-start {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 13, 24, 0.52);
    backdrop-filter: blur(3px);
    z-index: 45;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .layout.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: min(280px, 84vw);
    height: 100dvh;
    z-index: 50;
    padding: 16px 14px;
    border-bottom: 0;
    border-inline-end: 1px solid var(--sidebar-line);
    transform: translateX(102%);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: -12px 0 36px rgba(15, 13, 24, 0.38);
    overflow-y: auto;
  }

  .layout.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--sidebar-line);
  }

  .sidebar-head-row .brand {
    padding: 4px;
    border-bottom: 0;
    flex: 1;
    min-width: 0;
  }

  .mobile-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--sidebar-line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--sidebar-text);
    font-size: 14px;
  }

  .sidebar nav {
    display: grid;
    gap: 14px;
    overflow: visible;
    padding-bottom: 0;
  }

  .nav-group {
    display: grid;
    gap: 3px;
  }

  .nav-label {
    display: block;
  }

  .side-bottom {
    display: grid;
    gap: 6px;
    margin-top: auto;
  }

  .signed {
    display: grid;
    margin-bottom: 4px;
  }

  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    flex-shrink: 0;
    border-radius: 8px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--text);
    font-size: 18px;
    line-height: 1;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 12px 14px;
    gap: 10px;
  }

  .topbar h1 {
    font-size: 16px;
  }

  .connection {
    padding: 5px 8px;
    font-size: 10px;
  }

  .content {
    padding: 14px 12px 28px;
    gap: 12px;
  }

  .dashboard-intro {
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 12px;
  }

  .dashboard-actions {
    width: 100%;
    flex-wrap: wrap;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .dashboard-actions button {
    justify-content: center;
    width: 100%;
  }

  .stats-panel,
  .panel {
    padding: 14px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-card strong {
    font-size: 19px;
  }

  .panel-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .panel-actions {
    width: 100%;
  }

  .panel-actions button,
  .panel-head > button {
    width: 100%;
    justify-content: center;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .toolbar > div {
    min-width: 0 !important;
    width: 100%;
    flex-wrap: wrap;
  }

  .toolbar input[type="search"],
  .toolbar input:not([type="checkbox"]),
  .toolbar select {
    min-width: 0 !important;
    width: 100% !important;
    flex: 1 1 100% !important;
  }

  .edu-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .edu-tab {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .edu-course-meta-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
  }

  .edu-module-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .edu-module-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .edu-lesson-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .edu-lesson-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .edu-res-item {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .edu-res-actions {
    justify-content: flex-end;
  }

  .edu-q-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .edu-options-list {
    grid-template-columns: 1fr;
  }

  .drive-media-controls {
    grid-template-columns: 1fr;
  }

  .team-accordion > summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .modal {
    padding: 10px;
    align-items: flex-end;
  }

  .modal-card {
    width: 100% !important;
    max-height: 92dvh;
    padding: 14px;
    border-radius: 12px;
  }

  .modal-head {
    flex-wrap: wrap;
    gap: 8px;
  }

  .modal-actions {
    flex-wrap: wrap;
  }

  .modal-actions button {
    flex: 1 1 auto;
  }

  .cropper-modal {
    width: 100% !important;
    max-height: 94dvh;
  }

  .cropper-stage {
    padding: 10px;
  }

  .cropper-stage canvas {
    max-width: 100%;
    height: auto !important;
  }

  .cropper-controls {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 14px;
    gap: 10px;
  }

  .cropper-footer {
    flex-direction: column-reverse;
    align-items: stretch;
    padding: 12px 14px;
  }

  .cropper-footer-right {
    width: 100%;
    flex-direction: column-reverse;
  }

  .cropper-footer button,
  .cropper-footer-right button {
    width: 100%;
    justify-content: center;
  }

  .table-wrap {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  /* Dedicated Mobile Card Layout for Admin Tables (No Horizontal Table Scroll Clutter) */
  .topbar .eyebrow,
  .panel-head .eyebrow,
  .panel-head p,
  .dashboard-intro .eyebrow,
  .dashboard-intro p,
  .stat-card small,
  .connection {
    display: none !important;
  }

  table,
  tbody {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 10px;
  }

  tbody tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 2px 6px rgba(17, 15, 25, 0.04);
  }

  tbody td {
    border: 0;
    padding: 0;
    font-size: 12px;
  }

  tbody td:first-child {
    flex: 1 1 100%;
    font-size: 13px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--line);
  }

  /* Hide secondary desktop-only table columns on phone screens */
  #resources-table tbody td:nth-child(3),
  #resources-table tbody td:nth-child(4),
  .edu-table tbody td:nth-child(2),
  .edu-table tbody td:nth-child(4) {
    display: none;
  }

  tbody td:last-child {
    flex: 1 1 100%;
    padding-top: 6px;
    border-top: 1px solid var(--line);
  }

  .actions,
  .edu-table .actions {
    width: 100%;
    justify-content: flex-end;
    gap: 6px;
  }
}

@media (max-width: 480px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
