:root {
  --primary-950: #052b31;
  --primary-900: #0a3b3c;
  --primary-800: #105354;
  --primary-100: #e3f4f0;
  --primary-50: #f0f9f7;
  --accent: #ff8059;
  --accent-soft: #ffede7;
  --success: #168657;
  --success-soft: #e5f6ed;
  --warning: #b76a11;
  --warning-soft: #fff3df;
  --danger: #c34141;
  --danger-soft: #fdecec;
  --blue: #3f6f8c;
  --blue-soft: #eaf2f7;
  --purple: #715393;
  --purple-soft: #f1ecf8;
  --ink: #102624;
  --muted: #687a76;
  --line: #dce8e5;
  --surface: #ffffff;
  --canvas: #f4f8f7;
  --sidebar-width: 276px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --shadow-sm: 0 8px 24px rgba(5, 43, 49, 0.06);
  --shadow-lg: 0 28px 72px rgba(5, 43, 49, 0.18);
  color-scheme: light;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
}

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

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(38, 215, 176, 0.42);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

[hidden] {
  display: none !important;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.brand > span:last-child {
  display: grid;
  gap: 2px;
}

.brand strong {
  font-size: 15px;
  font-weight: 800;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
}

.brand-light {
  color: #fff;
}

.brand-light small {
  color: rgba(255, 255, 255, 0.65);
}

.brand-mark {
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.1);
}

.brand-mark span {
  position: absolute;
  display: block;
  border-radius: 4px;
  transform: rotate(45deg);
}

.brand-mark span:nth-child(1) {
  width: 13px;
  height: 13px;
  top: 9px;
  right: 9px;
  background: #26d7b0;
}

.brand-mark span:nth-child(2) {
  width: 10px;
  height: 10px;
  bottom: 9px;
  right: 11px;
  background: #fff;
}

.brand-mark span:nth-child(3) {
  width: 9px;
  height: 9px;
  top: 17px;
  left: 9px;
  background: var(--accent);
}

.eyebrow,
.panel-kicker {
  display: inline-block;
  color: var(--primary-800);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(430px, 0.92fr) minmax(460px, 1.08fr);
  min-height: 100vh;
  background: var(--surface);
}

.login-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 48px clamp(40px, 6vw, 88px);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 14% 12%, rgba(38, 215, 176, 0.2), transparent 28%),
    radial-gradient(circle at 90% 86%, rgba(255, 128, 89, 0.14), transparent 30%),
    linear-gradient(145deg, var(--primary-900), var(--primary-950));
}

.login-intro::before,
.login-intro::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.login-intro::before {
  width: 340px;
  height: 340px;
  left: -170px;
  top: 18%;
}

.login-intro::after {
  width: 540px;
  height: 540px;
  right: -370px;
  bottom: -190px;
}

.login-message,
.security-note,
.login-intro > .brand {
  position: relative;
  z-index: 1;
}

.login-message {
  max-width: 570px;
}

.login-message .eyebrow {
  margin-bottom: 18px;
  color: #8cebd6;
}

.login-message h1 {
  max-width: 540px;
  margin: 0;
  font-size: clamp(36px, 4.5vw, 64px);
  line-height: 1.24;
  letter-spacing: -0.035em;
}

.login-message p {
  max-width: 510px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  line-height: 1.9;
}

.security-note {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
}

.security-note .icon {
  color: #8cebd6;
}

.security-note > span {
  display: grid;
  gap: 2px;
}

.security-note strong {
  font-size: 12px;
}

.security-note small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 48px clamp(32px, 6vw, 100px);
  background:
    linear-gradient(rgba(10, 59, 60, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 59, 60, 0.025) 1px, transparent 1px),
    #fff;
  background-size: 32px 32px;
}

.login-card {
  width: min(100%, 440px);
}

.mobile-brand {
  display: none;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 12px;
  color: var(--primary-900);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--primary-50);
  font-size: 11px;
  font-weight: 800;
}

.login-card h2 {
  margin: 22px 0 8px;
  font-size: 34px;
  letter-spacing: -0.025em;
}

.login-card > p {
  margin: 0 0 32px;
  color: var(--muted);
  line-height: 1.7;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field > span:first-child,
.select-field > span:first-child {
  color: #35504d;
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.select-field select,
.search-field input {
  width: 100%;
  min-height: 50px;
  padding: 11px 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: 0;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field textarea {
  min-height: 108px;
  resize: vertical;
  line-height: 1.7;
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.select-field select:hover,
.search-field input:hover {
  border-color: #b8cfca;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.select-field select:focus,
.search-field input:focus {
  border-color: var(--primary-800);
  box-shadow: 0 0 0 4px rgba(38, 215, 176, 0.12);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-left: 52px;
}

.password-field .icon-button {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
}

.form-error {
  margin: -4px 0 16px !important;
  padding: 11px 13px;
  color: var(--danger);
  border: 1px solid #f3caca;
  border-radius: 12px;
  background: var(--danger-soft);
  font-size: 12px;
}

.development-hint,
.form-note {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}

.button,
.icon-button,
.nav-item,
.logout-button,
.text-button {
  border: 0;
  font-weight: 750;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 13px;
  font-size: 12px;
}

.button.wide {
  width: 100%;
  min-height: 52px;
}

.button.primary {
  color: #fff;
  background: var(--primary-900);
  box-shadow: 0 9px 22px rgba(10, 59, 60, 0.15);
}

.button.primary:hover {
  background: var(--primary-800);
}

.button.secondary {
  color: var(--primary-900);
  border: 1px solid var(--line);
  background: #fff;
}

.button.secondary:hover {
  border-color: #b8cfca;
  background: var(--primary-50);
}

.button.danger {
  color: #fff;
  background: var(--danger);
}

.button.danger:hover {
  background: #aa3434;
}

.button.success {
  color: #fff;
  background: var(--success);
}

.button.small {
  min-height: 38px;
  padding: 7px 11px;
  border-radius: 11px;
  font-size: 11px;
}

.button.review-button,
.button.review-preview-button {
  min-height: 44px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  color: var(--muted);
  border-radius: 13px;
  background: transparent;
}

.icon-button:hover {
  color: var(--primary-900);
  background: var(--primary-100);
}

.icon-button.compact {
  width: 44px;
  height: 44px;
}

.admin-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 30;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  padding: 24px 18px 18px;
  color: #fff;
  background:
    radial-gradient(circle at 8% 4%, rgba(38, 215, 176, 0.14), transparent 28%),
    linear-gradient(180deg, var(--primary-900), var(--primary-950));
  box-shadow: -12px 0 40px rgba(5, 43, 49, 0.09);
}

.sidebar-brand {
  min-height: 52px;
  padding: 0 6px;
}

.sidebar-close {
  display: none;
  margin-right: auto;
  color: #fff;
}

.sidebar-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
  display: grid;
  gap: 6px;
  margin-top: 36px;
}

.nav-label {
  margin: 0 12px 7px;
  color: rgba(255, 255, 255, 0.43);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  padding: 10px 13px;
  color: rgba(255, 255, 255, 0.63);
  border-radius: 14px;
  background: transparent;
  text-align: right;
  font-size: 12px;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
  box-shadow: inset -3px 0 #26d7b0;
}

.nav-item.active .icon {
  color: #72e6cc;
}

.nav-count {
  min-width: 23px;
  min-height: 23px;
  margin-right: auto;
  padding: 4px 6px;
  color: #fff;
  border-radius: 8px;
  background: var(--accent);
  font-size: 9px;
  text-align: center;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.admin-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px;
}

.admin-chip > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.admin-chip strong,
.admin-chip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-chip strong {
  font-size: 11px;
}

.admin-chip small {
  color: rgba(255, 255, 255, 0.48);
  font-size: 9px;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  color: var(--primary-900);
  border-radius: 13px;
  background: #8cebd6;
  font-size: 13px;
  font-weight: 800;
}

.logout-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 9px 12px;
  color: rgba(255, 255, 255, 0.59);
  border-radius: 13px;
  background: transparent;
  text-align: right;
  font-size: 11px;
}

.logout-button:hover {
  color: #fff;
  background: rgba(255, 128, 89, 0.12);
}

.workspace {
  min-height: 100vh;
  margin-right: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  min-height: 86px;
  padding: 16px clamp(22px, 3.2vw, 48px);
  border-bottom: 1px solid rgba(220, 232, 229, 0.88);
  background: rgba(244, 248, 247, 0.91);
  backdrop-filter: blur(18px);
}

.menu-button {
  display: none;
}

.page-heading {
  display: grid;
  gap: 2px;
}

.page-heading span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.page-heading h1 {
  margin: 0;
  font-size: 20px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
}

.system-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 11px;
  color: var(--success);
  border: 1px solid #cce9d9;
  border-radius: 999px;
  background: var(--success-soft);
  font-size: 10px;
  font-weight: 800;
}

.system-status span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(22, 134, 87, 0.1);
}

.workspace-content {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: 30px clamp(22px, 3.2vw, 48px) 56px;
}

.welcome-banner {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 184px;
  padding: 30px 32px;
  overflow: hidden;
  color: #fff;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 10% 20%, rgba(38, 215, 176, 0.17), transparent 30%),
    radial-gradient(circle at 92% 88%, rgba(255, 128, 89, 0.16), transparent 29%),
    linear-gradient(135deg, var(--primary-900), var(--primary-950));
  box-shadow: var(--shadow-sm);
}

.welcome-banner::after {
  content: "";
  position: absolute;
  left: -80px;
  bottom: -160px;
  width: 310px;
  height: 310px;
  border: 42px solid rgba(255, 255, 255, 0.035);
  border-radius: 50%;
}

.welcome-banner > * {
  position: relative;
  z-index: 1;
}

.welcome-banner .eyebrow {
  color: #8cebd6;
}

.welcome-banner h2 {
  margin: 9px 0 5px;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.025em;
}

.welcome-banner p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.date-card {
  display: grid;
  gap: 4px;
  min-width: 148px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.07);
}

.date-card span {
  color: rgba(255, 255, 255, 0.55);
  font-size: 9px;
}

.date-card strong {
  font-size: 11px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 110px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 5px 16px rgba(5, 43, 49, 0.025);
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  color: var(--primary-900);
  border-radius: 15px;
  background: var(--primary-100);
}

.stat-icon.orange {
  color: var(--accent);
  background: var(--accent-soft);
}

.stat-icon.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.stat-icon.purple {
  color: var(--purple);
  background: var(--purple-soft);
}

.stat-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

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

.stat-copy strong {
  font-size: 24px;
  letter-spacing: -0.02em;
}

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

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(5, 43, 49, 0.025);
}

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

.panel-header.padded {
  padding: 20px 22px;
}

.panel-header h2,
.section-toolbar h2,
.dialog h2 {
  margin: 4px 0 0;
  font-size: 17px;
}

.text-button {
  min-height: 42px;
  padding: 7px 9px;
  color: var(--primary-800);
  border-radius: 10px;
  background: transparent;
  font-size: 10px;
}

.text-button:hover {
  background: var(--primary-50);
}

.compact-list,
.activity-list {
  display: grid;
  padding: 5px 18px 12px;
}

.compact-item,
.activity-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 70px;
  padding: 10px 4px;
  border-bottom: 1px solid #edf3f1;
}

.compact-item:last-child,
.activity-item:last-child {
  border-bottom: 0;
}

.item-avatar,
.activity-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  color: var(--primary-900);
  border-radius: 13px;
  background: var(--primary-100);
  font-size: 11px;
  font-weight: 800;
}

.activity-mark {
  width: 38px;
  height: 38px;
}

.compact-copy,
.activity-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.compact-copy strong,
.activity-copy strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-copy small,
.activity-copy small {
  color: var(--muted);
  font-size: 9px;
}

.compact-meta {
  display: grid;
  gap: 3px;
  margin-right: auto;
  text-align: left;
}

.compact-meta strong {
  color: var(--primary-900);
  font-size: 10px;
}

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

.section-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.section-toolbar h2 {
  margin-top: 6px;
  font-size: 26px;
}

.section-toolbar p,
.dialog p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.select-field {
  display: grid;
  min-width: 180px;
  gap: 7px;
}

.select-field select {
  min-height: 46px;
  padding: 8px 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.select-field.inline {
  min-width: 150px;
}

.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.search-field {
  position: relative;
  width: min(100%, 430px);
}

.search-field .icon {
  position: absolute;
  top: 14px;
  right: 14px;
  color: var(--muted);
}

.search-field input {
  padding-right: 44px;
}

.table-panel {
  overflow: hidden;
}

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

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

th,
td {
  padding: 15px 18px;
  border-bottom: 1px solid #e9f0ee;
  text-align: right;
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: #fbfdfc;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

td {
  font-size: 11px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fbfdfc;
}

.entity-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
}

.entity-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.entity-copy strong,
.entity-copy small {
  overflow: hidden;
  max-width: 260px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-copy strong {
  font-size: 11px;
}

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

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status.active,
.status.approved {
  color: var(--success);
  background: var(--success-soft);
}

.status.submitted {
  color: var(--warning);
  background: var(--warning-soft);
}

.status.rejected,
.status.suspended,
.status.revoked {
  color: var(--danger);
  background: var(--danger-soft);
}

.status.draft {
  color: var(--blue);
  background: var(--blue-soft);
}

.status.redeemed {
  color: var(--purple);
  background: var(--purple-soft);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.empty-state,
.loading-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 12px;
}

.empty-state p {
  max-width: 330px;
  margin: 5px 0 0;
  font-size: 10px;
  line-height: 1.7;
}

.loading-line {
  width: 100%;
  height: 54px;
  margin: 8px 0;
  border-radius: 13px;
  background:
    linear-gradient(90deg, #edf3f1 25%, #f8fbfa 50%, #edf3f1 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.cards-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.36fr) minmax(0, 0.64fr);
  gap: 18px;
}

.create-card-panel {
  padding-bottom: 20px;
}

.create-card-panel > .field,
.create-card-panel > .button,
.create-card-panel > .form-note {
  margin-right: 22px;
  margin-left: 22px;
}

.create-card-panel > .field:first-of-type {
  margin-top: 20px;
}

.secure-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--success);
  border-radius: 13px;
  background: var(--success-soft);
}

.success-text {
  color: var(--success);
}

.generated-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 360px;
  padding: 18px 22px 22px;
  overflow-y: auto;
}

.generated-code {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px dashed #a9c9c2;
  border-radius: 14px;
  background: var(--primary-50);
}

.generated-code-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.generated-code-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.generated-code code {
  direction: ltr;
  min-width: 0;
  overflow: hidden;
  color: var(--primary-900);
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generated-code .icon-button {
  width: 44px;
  height: 44px;
  margin-right: auto;
}

.cards-history {
  margin-top: 18px;
}

.generated-card-actions,
.card-history-actions,
.inventory-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.card-history-actions {
  justify-content: flex-end;
}

.card-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 12px;
  color: var(--primary-900);
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.card-select-all input,
.card-print-checkbox {
  width: 19px;
  height: 19px;
  margin: 0;
  accent-color: var(--primary-800);
  cursor: pointer;
}

.card-checkbox-target {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
}

.card-checkbox-target:hover {
  background: var(--primary-50);
}

.card-checkbox-target:has(input:disabled) {
  cursor: not-allowed;
}

.card-select-all:has(input:disabled) {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.62;
}

.button-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  min-height: 24px;
  padding: 2px 6px;
  color: var(--primary-900);
  border-radius: 999px;
  background: var(--primary-100);
  font-size: 11px;
}

.cards-print-note {
  margin: 0;
  padding: 11px 18px;
  color: var(--muted);
  border-top: 1px solid #edf3f1;
  border-bottom: 1px solid #edf3f1;
  background: #fbfdfc;
  font-size: 12px;
  line-height: 1.7;
}

.selection-column,
.selection-cell {
  width: 54px;
  min-width: 54px;
  text-align: center;
}

.selection-cell .card-print-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.32;
}

.cards-history .button.small {
  min-height: 44px;
}

.card-code-cell {
  display: grid;
  min-width: 150px;
  gap: 4px;
}

.card-code-cell code {
  color: var(--primary-900);
  font-weight: 800;
}

.card-code-cell small {
  color: var(--muted);
  font-size: 11px;
}

.inventory-toolbar {
  align-items: center;
}

.inventory-toolbar p {
  font-size: 12px;
}

.inventory-toolbar-actions .button {
  min-width: 132px;
}

.inventory-load-state {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 360px;
  padding: 36px;
  color: var(--muted);
  text-align: center;
}

.inventory-load-state strong {
  margin-top: 14px;
  color: var(--ink);
  font-size: 16px;
}

.inventory-load-state small {
  max-width: 390px;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.7;
}

.inventory-load-state .button {
  margin-top: 18px;
}

.inventory-loader {
  width: 44px;
  height: 44px;
  border: 4px solid var(--primary-100);
  border-top-color: var(--primary-800);
  border-radius: 50%;
  animation: review-spin 750ms linear infinite;
}

.inventory-content {
  display: grid;
  gap: 18px;
}

.teacher-inventory-controls { flex-wrap:wrap; align-items:flex-end; }
.teacher-inventory-controls input { padding:10px 12px; border:1px solid #d5e1dc; border-radius:10px; background:#fff; color:#193e36; font:inherit; min-height:42px; }
.teacher-finance-table th { white-space:nowrap; }
.teacher-finance-table td { padding:14px 12px; font-size:13px; line-height:1.7; }
.teacher-finance-table tbody tr:nth-child(even) { background:#f6faf8; }
.teacher-finance-table tfoot { background:#eaf5ef; font-weight:800; }
.teacher-finance-table tfoot td { border-top:2px solid #bddccc; }
.teacher-students-panel { padding:24px; }
.roster-pagination { display:flex; justify-content:space-between; align-items:center; margin-top:18px; }

.teacher-inventory-panel {
  position: relative;
  overflow: hidden;
  padding: 22px;
  background:
    radial-gradient(circle at 4% 0%, rgba(242, 138, 34, 0.11), transparent 25%),
    linear-gradient(145deg, #ffffff, #f7fbfa);
}

.teacher-inventory-panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--primary-800) 0 75%, #ef861f 75%);
  content: "";
}

.teacher-inventory-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.teacher-inventory-heading h2 {
  margin: 4px 0;
  font-size: 23px;
}

.teacher-inventory-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.teacher-inventory-controls {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.teacher-inventory-controls label {
  display: grid;
  min-width: 220px;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.teacher-inventory-controls select {
  min-height: 46px;
  padding: 0 13px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  font: inherit;
  font-size: 13px;
}

.teacher-inventory-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.teacher-finance-metric {
  display: grid;
  min-height: 86px;
  align-content: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.teacher-finance-metric small {
  color: var(--muted);
  font-size: 11px;
}

.teacher-finance-metric strong {
  color: var(--ink);
  font-size: 18px;
  white-space: nowrap;
}

.teacher-finance-metric.teacher {
  border-color: transparent;
  background: linear-gradient(135deg, #087c75, #07524e);
}

.teacher-finance-metric.platform {
  border-color: transparent;
  background: linear-gradient(135deg, #f49a30, #e87318);
}

.teacher-finance-metric.teacher small,
.teacher-finance-metric.teacher strong,
.teacher-finance-metric.platform small,
.teacher-finance-metric.platform strong {
  color: #fff;
}

.revenue-share-strip {
  display: flex;
  height: 39px;
  margin: 0 0 15px;
  overflow: hidden;
  color: #fff;
  border-radius: 12px;
  direction: ltr;
}

.revenue-share-strip span {
  display: flex;
  width: var(--share);
  align-items: center;
  justify-content: center;
  gap: 6px;
  direction: rtl;
  font-size: 11px;
}

.revenue-share-strip .teacher-share {
  background: #0a756f;
}

.revenue-share-strip .platform-share {
  background: #ed831d;
}

.teacher-finance-table {
  min-width: 870px;
}

.teacher-earning-cell {
  color: #08766f;
  font-weight: 850;
}

.platform-earning-cell {
  color: #d26611;
  font-weight: 850;
}

.inventory-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.inventory-metric {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 112px;
  padding: 17px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.inventory-metric::after {
  position: absolute;
  inset: auto auto -26px -22px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  opacity: 0.045;
}

.inventory-metric.green {
  color: var(--success);
}

.inventory-metric.blue {
  color: var(--blue);
}

.inventory-metric.purple {
  color: var(--purple);
}

.inventory-metric.orange {
  color: var(--warning);
}

.inventory-metric-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: color-mix(in srgb, currentColor 11%, white);
}

.inventory-metric-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.inventory-metric-copy small,
.inventory-metric-copy span {
  color: var(--muted);
  font-size: 12px;
}

.inventory-metric-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.inventory-panel {
  min-width: 0;
  overflow: hidden;
}

.inventory-panel .panel-header {
  min-height: 78px;
}

.inventory-table {
  min-width: 480px;
}

.inventory-table th {
  font-size: 12px;
}

.inventory-table td {
  font-size: 13px;
}

.inventory-table td:first-child {
  color: var(--ink);
  font-weight: 800;
}

.inventory-total-row td {
  color: var(--primary-900);
  background: var(--primary-50);
  font-weight: 800;
}

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

.inventory-activity-table {
  min-width: 760px;
}

.inventory-generated-at {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.inventory-table-empty {
  padding: 30px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.print-root {
  display: none;
}

.dialog {
  width: min(calc(100% - 32px), 510px);
  padding: 0;
  color: var(--ink);
  border: 0;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.dialog::backdrop {
  background: rgba(5, 22, 24, 0.58);
  backdrop-filter: blur(4px);
}

.dialog > form {
  display: grid;
  gap: 20px;
  padding: 26px;
}

.dialog-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--warning);
  border-radius: 15px;
  background: var(--warning-soft);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 3px;
}

.dialog-actions .button {
  min-width: 104px;
}

.course-review-dialog {
  width: min(calc(100% - 32px), 1080px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  border: 0;
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.course-review-dialog::backdrop {
  background: rgba(5, 22, 24, 0.64);
  backdrop-filter: blur(5px);
}

.course-review-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: calc(100dvh - 32px);
}

.course-review-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.course-review-header h2 {
  margin: 5px 0 0;
  font-size: 22px;
}

.course-review-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.course-review-header .icon-button {
  flex: 0 0 auto;
}

.course-review-status {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 410px;
  padding: 40px 24px;
  color: var(--muted);
  text-align: center;
}

.course-review-status strong {
  margin-top: 14px;
  color: var(--ink);
  font-size: 15px;
}

.course-review-status small {
  max-width: 360px;
  margin-top: 6px;
  font-size: 10px;
  line-height: 1.7;
}

.course-review-status .button {
  margin-top: 18px;
}

.review-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid var(--primary-100);
  border-top-color: var(--primary-800);
  border-radius: 50%;
  animation: review-spin 750ms linear infinite;
}

@keyframes review-spin {
  to {
    transform: rotate(360deg);
  }
}

.course-review-content {
  min-height: 0;
  padding: 22px 24px 26px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 10% 0%, rgba(38, 215, 176, 0.08), transparent 260px),
    var(--canvas);
}

.review-overview,
.review-videos-section,
.review-processing-panel,
.review-decision-panel,
.review-decision-complete {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.review-overview,
.review-videos-section {
  padding: 20px;
}

.review-videos-section,
.review-processing-panel,
.review-decision-panel,
.review-decision-complete {
  margin-top: 16px;
}

.review-course-heading,
.review-section-heading,
.review-preview-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.review-course-heading h3,
.review-section-heading h3,
.review-decision-copy h3 {
  margin: 5px 0 0;
  font-size: 18px;
}

.review-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.review-fact {
  display: grid;
  gap: 6px;
  min-height: 78px;
  padding: 14px;
  border: 1px solid #e9f1ef;
  border-radius: 14px;
  background: #fbfdfc;
}

.review-fact span,
.review-description > span,
.review-preview-heading span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.review-fact strong {
  align-self: end;
  color: var(--primary-900);
  font-size: 13px;
}

.review-description {
  margin-top: 14px;
  padding: 15px;
  border-radius: 14px;
  background: var(--primary-50);
}

.review-description p {
  margin: 7px 0 0;
  color: #3f5551;
  font-size: 11px;
  line-height: 1.9;
  white-space: pre-wrap;
}

.review-count {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 11px;
  color: var(--primary-800);
  border-radius: 999px;
  background: var(--primary-100);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.review-video-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.74fr) minmax(360px, 1.26fr);
  gap: 14px;
  margin-top: 18px;
}

.review-videos-list {
  display: grid;
  align-content: start;
  gap: 9px;
  max-height: 390px;
  padding-left: 3px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.review-video-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.review-video-item.active {
  border-color: #9ec9bf;
  background: var(--primary-50);
  box-shadow: 0 0 0 2px rgba(16, 83, 84, 0.08);
}

.review-video-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.review-video-copy strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  color: var(--muted);
  font-size: 9px;
}

.review-video-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.review-video-meta .icon {
  width: 14px;
  height: 14px;
}

.review-preview-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f9fcfb;
}

.review-preview-heading {
  min-height: 38px;
  margin-bottom: 10px;
}

.review-preview-heading > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.review-preview-heading strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-preview-heading small {
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.review-player {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 220px;
  overflow: hidden;
  border-radius: 14px;
  background: #07191a;
  aspect-ratio: 16 / 9;
}

.review-player video {
  width: 100%;
  height: 100%;
  background: #07191a;
  object-fit: contain;
}

.review-player-empty {
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 24px;
  color: #bdd1cd;
  text-align: center;
}

.review-player-empty .icon {
  width: 42px;
  height: 42px;
  margin-bottom: 3px;
  color: #74b9aa;
}

.review-player-empty strong {
  color: #fff;
  font-size: 12px;
}

.review-player-empty small {
  font-size: 9px;
}

.review-preview-message {
  min-height: 18px;
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 9px;
}

.review-preview-message.error {
  color: var(--danger);
}

.review-empty-videos {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 20px;
  color: var(--muted);
  border: 1px dashed #c9dbd7;
  border-radius: 14px;
  background: #fbfdfc;
  text-align: center;
}

.review-empty-videos strong {
  color: var(--ink);
  font-size: 11px;
}

.review-empty-videos small {
  margin-top: 5px;
  font-size: 9px;
}

.review-processing-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-color: #cfe1dc;
  background:
    radial-gradient(circle at 8% 0%, rgba(236, 125, 36, 0.1), transparent 190px),
    linear-gradient(145deg, #ffffff, #f4faf7);
}

.review-processing-panel[hidden] {
  display: none;
}

.review-processing-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.review-processing-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--primary-800), #1b9b85);
  box-shadow: 0 9px 20px rgba(16, 83, 84, 0.2);
}

.review-processing-icon .icon {
  width: 20px;
  height: 20px;
}

.review-processing-heading h3 {
  margin: 4px 0 0;
  font-size: 15px;
}

.review-processing-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.review-processing-heading > strong {
  color: var(--primary-800);
  font-size: 18px;
}

.review-processing-track {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #dceae6;
  box-shadow: inset 0 1px 3px rgba(16, 63, 57, 0.1);
}

.review-processing-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-800), #26b99a, #ee812b);
  box-shadow: 0 0 14px rgba(38, 185, 154, 0.42);
  transition: width 220ms ease;
}

.review-processing-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.review-processing-metrics span {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  border: 1px solid #e0ebe7;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.78);
}

.review-processing-metrics small {
  color: var(--muted);
  font-size: 8px;
}

.review-processing-metrics b {
  color: #25443d;
  font-size: 10px;
}

.review-processing-videos {
  margin: -3px 0 0;
  color: #587169;
  font-size: 9px;
}

.review-processing-panel[data-status="completed"] {
  border-color: #a9d9c3;
  background: linear-gradient(145deg, #f5fff9, #eaf9f1);
}

.review-processing-panel[data-status="failed"] {
  border-color: #edb7b2;
  background: #fff7f6;
}

.review-processing-panel[data-status="failed"] .review-processing-icon {
  background: var(--danger);
}

.review-decision-panel {
  display: grid;
  grid-template-columns: minmax(200px, 0.8fr) minmax(280px, 1.2fr);
  gap: 16px 22px;
  padding: 20px;
}

.review-decision-copy p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.review-decision-note {
  margin: 0;
}

.review-decision-error {
  grid-column: 1 / -1;
  margin: -4px 0 0 !important;
}

.review-decision-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.review-decision-actions .button {
  min-width: 154px;
  min-height: 46px;
}

.review-decision-complete {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 20px;
  color: var(--success);
  border-color: #bde3cf;
  background: var(--success-soft);
}

.review-decision-complete > .icon {
  width: 28px;
  height: 28px;
}

.review-decision-complete span {
  display: grid;
  gap: 3px;
}

.review-decision-complete strong {
  font-size: 11px;
}

.review-decision-complete small {
  color: #47745f;
  font-size: 9px;
}

.user-dialog {
  width: min(calc(100% - 32px), 680px);
}

.credential-dialog {
  width: min(calc(100% - 32px), 560px);
}

.credential-result {
  display: grid;
  gap: 18px;
}

.credential-result h2 {
  margin: 5px 0 0;
}

.credential-result p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.credential-result-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #fff;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--primary-800), #1b9b85);
  box-shadow: 0 10px 24px rgba(16, 83, 84, 0.2);
}

.credential-result-icon .icon {
  width: 27px;
  height: 27px;
}

.credential-value-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.credential-value-row input {
  color: var(--primary-950);
  background: var(--primary-50);
  font-family: Consolas, "Courier New", monospace;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-align: center;
}

.credential-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  color: #78501d;
  border: 1px solid #f0d8b3;
  border-radius: 14px;
  background: var(--warning-soft);
  font-size: 11px;
  line-height: 1.7;
}

.credential-warning .icon {
  margin-top: 2px;
  flex: 0 0 auto;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.dialog-heading h2 {
  margin: 4px 0 0;
}

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

.form-grid .field.full {
  grid-column: 1 / -1;
}

.toast-region {
  position: fixed;
  z-index: 100;
  left: 24px;
  bottom: 24px;
  display: grid;
  gap: 9px;
  width: min(calc(100% - 48px), 380px);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  color: #fff;
  border-radius: 14px;
  background: var(--primary-950);
  box-shadow: var(--shadow-lg);
  font-size: 11px;
  line-height: 1.6;
  animation: toast-in 180ms ease-out;
}

.toast.error {
  background: #812e2e;
}

.toast.success .icon {
  color: #8cebd6;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.sidebar-scrim {
  position: fixed;
  z-index: 25;
  inset: 0;
  background: rgba(5, 22, 24, 0.5);
}

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

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

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

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

  .cards-layout {
    grid-template-columns: minmax(280px, 0.42fr) minmax(0, 0.58fr);
  }

  .generated-codes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 880px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-intro {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
    padding: 32px 22px;
  }

  .mobile-brand {
    display: flex;
    margin-bottom: 40px;
  }

  .mobile-brand .brand-mark {
    background: var(--primary-900);
  }

  .sidebar {
    width: min(86vw, 300px);
    transform: translateX(110%);
    transition: transform 220ms ease;
  }

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

  .sidebar-close,
  .menu-button {
    display: inline-grid;
  }

  .workspace {
    margin-right: 0;
  }

  .topbar {
    min-height: 76px;
  }

  .menu-button {
    margin-left: 10px;
  }

  .cards-layout {
    grid-template-columns: 1fr;
  }

  .inventory-table-grid {
    grid-template-columns: 1fr;
  }

  .card-history-actions {
    justify-content: flex-start;
  }

  .review-video-layout {
    grid-template-columns: 1fr;
  }

  .review-videos-list {
    max-height: 310px;
  }

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

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

  .review-decision-error,
  .review-decision-actions {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 12px 16px;
  }

  .workspace-content {
    padding: 22px 16px 44px;
  }

  .topbar-actions .system-status,
  .topbar-actions .button span {
    display: none;
  }

  .topbar-actions .button {
    width: 44px;
    min-height: 44px;
    padding: 0;
  }

  .welcome-banner {
    align-items: flex-start;
    flex-direction: column;
    min-height: 220px;
    padding: 24px;
  }

  .date-card {
    min-width: 0;
    width: 100%;
  }

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

  .stat-card {
    min-height: 92px;
  }

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

  .section-toolbar .button,
  .section-toolbar .select-field {
    width: 100%;
  }

  .inventory-toolbar-actions,
  .generated-card-actions,
  .card-history-actions {
    width: 100%;
  }

  .inventory-toolbar-actions .button,
  .generated-card-actions .button,
  .card-history-actions > * {
    width: 100%;
  }

  .inventory-metrics {
    grid-template-columns: 1fr;
  }

  .teacher-inventory-panel {
    padding: 18px 14px;
  }

  .teacher-inventory-heading,
  .teacher-inventory-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .teacher-inventory-controls,
  .teacher-inventory-controls label,
  .teacher-inventory-controls .button {
    width: 100%;
  }

  .teacher-inventory-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .inventory-metric {
    min-height: 96px;
  }

  .filter-bar {
    flex-direction: column;
  }

  .search-field,
  .select-field.inline {
    width: 100%;
  }

  .panel-header {
    align-items: flex-start;
  }

  .generated-codes {
    padding: 14px;
  }

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

  .form-grid .field.full {
    grid-column: auto;
  }

  .credential-value-row {
    grid-template-columns: 1fr;
  }

  .credential-value-row .button {
    width: 100%;
  }

  .course-review-dialog {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 20px;
  }

  .course-review-shell {
    max-height: calc(100dvh - 16px);
  }

  .course-review-header {
    padding: 17px 16px;
  }

  .course-review-header h2 {
    font-size: 18px;
  }

  .course-review-content {
    padding: 15px 12px 18px;
  }

  .review-overview,
  .review-videos-section,
  .review-decision-panel {
    padding: 15px;
    border-radius: 17px;
  }

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

  .review-video-item {
    grid-template-columns: 1fr;
  }

  .review-video-item .button {
    width: 100%;
  }

  .review-player {
    min-height: 174px;
  }

  .review-decision-actions {
    flex-direction: column-reverse;
  }

  .review-decision-actions .button {
    width: 100%;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .dialog-actions .button {
    width: 100%;
  }

  .toast-region {
    right: 16px;
    left: 16px;
    bottom: 16px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@page {
  size: A4 portrait;
  margin: 9mm;
}

@media print {
  :root {
    color-scheme: light;
  }

  html,
  body {
    min-width: 0;
    min-height: 0;
    color: #102624;
    background: #fff !important;
  }

  body {
    margin: 0;
    font-family: Arial, Tahoma, sans-serif;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body > *:not(.print-root) {
    display: none !important;
  }

  body > .print-root {
    display: block !important;
  }

  .print-root,
  .print-root * {
    box-sizing: border-box;
  }

  .print-root {
    width: 100%;
    direction: rtl;
    color: #102624;
    background: #fff;
  }

  .print-document {
    width: 100%;
  }

  .print-brand {
    display: inline-block;
    margin-bottom: 2mm;
    color: #0a3b3c;
    font-size: 8pt;
    font-weight: 800;
    letter-spacing: 0.04em;
  }

  .print-report-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8mm;
    padding: 0 0 5mm;
    border-bottom: 0.7mm solid #0a3b3c;
  }

  .print-report-header h1,
  .print-sheet-header h1 {
    margin: 0;
    color: #052b31;
    font-size: 19pt;
    line-height: 1.2;
  }

  .print-report-header p {
    margin: 2mm 0 0;
    color: #526763;
    font-size: 8pt;
  }

  .print-report-header dl {
    min-width: 58mm;
    margin: 0;
    padding: 3mm 4mm;
    border: 0.3mm solid #cbdad7;
    border-radius: 3mm;
    background: #f4f8f7;
  }

  .print-report-header dl div {
    display: flex;
    justify-content: space-between;
    gap: 6mm;
    padding: 1mm 0;
  }

  .print-report-header dt,
  .print-report-header dd {
    margin: 0;
    font-size: 7.5pt;
  }

  .print-report-header dt {
    color: #687a76;
  }

  .print-report-header dd {
    font-weight: 700;
  }

  .print-inventory-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2.5mm;
    margin: 4mm 0;
  }

  .print-inventory-metrics article {
    display: grid;
    min-height: 20mm;
    padding: 3mm;
    border: 0.3mm solid #cfdfdb;
    border-radius: 2.5mm;
    background: #f7faf9;
  }

  .print-inventory-metrics span,
  .print-inventory-metrics small {
    color: #687a76;
    font-size: 6.5pt;
  }

  .print-inventory-metrics strong {
    align-self: center;
    color: #0a3b3c;
    font-size: 11pt;
  }

  .print-report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3mm;
  }

  .print-report-section {
    break-inside: avoid;
    margin: 0 0 3mm;
    overflow: hidden;
    border: 0.3mm solid #d7e3e0;
    border-radius: 2.5mm;
  }

  .print-report-section h2 {
    margin: 0;
    padding: 2.5mm 3mm;
    color: #0a3b3c;
    border-bottom: 0.3mm solid #d7e3e0;
    background: #eaf4f1;
    font-size: 9pt;
  }

  .print-report-section table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
  }

  .print-report-section th,
  .print-report-section td {
    padding: 1.8mm 2.2mm;
    border-bottom: 0.2mm solid #e5ecea;
    font-size: 6.8pt;
    text-align: right;
  }

  .print-report-section th {
    color: #526763;
    background: #fafcfb;
    font-weight: 800;
  }

  .print-report-section tr:last-child td {
    border-bottom: 0;
  }

  .print-activity-section {
    margin-top: 1mm;
  }

  .print-report-footer,
  .print-sheet-footer {
    display: flex;
    justify-content: space-between;
    gap: 6mm;
    margin-top: 4mm;
    padding-top: 2.5mm;
    color: #687a76;
    border-top: 0.3mm solid #d7e3e0;
    font-size: 6.5pt;
  }

  .print-sheet-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8mm;
    margin-bottom: 5mm;
    padding-bottom: 4mm;
    border-bottom: 0.7mm solid #0a3b3c;
  }

  .print-sheet-header > div:last-child {
    display: grid;
    gap: 1mm;
    text-align: left;
  }

  .print-sheet-header > div:last-child strong {
    color: #0a3b3c;
    font-size: 10pt;
  }

  .print-sheet-header > div:last-child small {
    color: #687a76;
    font-size: 7pt;
  }

  .print-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4mm;
  }

  .print-recharge-card {
    position: relative;
    display: grid;
    grid-template-rows: auto auto auto 1fr;
    min-height: 60mm;
    padding: 4mm;
    overflow: hidden;
    break-inside: avoid;
    color: #102624;
    border: 0.35mm solid #789b94;
    border-radius: 4mm;
    background:
      radial-gradient(circle at 8% 0%, rgba(38, 215, 176, 0.16), transparent 24mm),
      #fff;
  }

  .print-card-accent {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 2.2mm;
    background: linear-gradient(90deg, #0a3b3c, #26d7b0);
  }

  .print-recharge-card > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 4mm;
    margin-top: 1mm;
  }

  .print-recharge-card > header > span {
    display: grid;
    gap: 0.6mm;
  }

  .print-recharge-card > header > span strong {
    color: #0a3b3c;
    font-size: 9pt;
  }

  .print-recharge-card > header > span small {
    color: #687a76;
    font-size: 6.5pt;
  }

  .print-card-amount {
    padding: 1.6mm 2.5mm;
    color: #fff;
    border-radius: 2mm;
    background: #0a3b3c;
    font-size: 9pt;
    white-space: nowrap;
  }

  .print-card-code {
    display: grid;
    gap: 1mm;
    margin: 0;
    padding: 2.5mm 2mm;
    border: 0.3mm solid #bcd3ce;
    border-radius: 2.4mm;
    background: #f0f9f7;
    text-align: center;
  }

  .print-card-code span {
    color: #687a76;
    font-size: 6.5pt;
    font-weight: 700;
  }

  .print-card-code code {
    color: #052b31;
    font-family: Consolas, "Courier New", monospace;
    font-size: 11pt;
    font-weight: 800;
    letter-spacing: 0.07em;
    white-space: nowrap;
  }

  .print-recharge-card dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2mm;
    margin: 0;
  }

  .print-recharge-card dl div {
    display: grid;
    gap: 0.5mm;
  }

  .print-recharge-card dt,
  .print-recharge-card dd {
    margin: 0;
    font-size: 6.2pt;
  }

  .print-recharge-card dt {
    color: #687a76;
  }

  .print-recharge-card dd {
    font-weight: 700;
    overflow-wrap: anywhere;
  }

  .print-recharge-card p {
    align-self: end;
    margin: 2.5mm 0 0;
    color: #526763;
    font-size: 6.4pt;
    line-height: 1.45;
  }
  .print-card-brand { position: relative; padding-right: 11mm; min-height: 10mm; }
  .print-card-logo { position: absolute; right: 0; top: 0; width: 9mm; height: 9mm; border-radius: 2mm; }
  .print-card-redeem { display: grid; grid-template-columns: 24mm minmax(0, 1fr); gap: 2mm; align-items: center; margin: 3mm 0; direction: ltr; }
  .print-card-qr { display: block; width: 24mm; height: 24mm; background: #fff; }
  .print-card-code small { font-size: 5.7pt; color: #526763; direction: rtl; }
}
.brand-mark{background:url('/admin/darb-logo.png') center/cover no-repeat!important;border-radius:14px!important;overflow:hidden;box-shadow:0 8px 22px rgba(5,57,58,.22)}
.brand-mark span,.brand-mark i{display:none!important}
.teacher-inventory-panel > .teacher-inventory-heading { display:block; }
.teacher-inventory-panel,.teacher-students-panel { scroll-margin-top:100px; }
.teacher-inventory-panel .teacher-inventory-controls { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:end; width:100%; margin:20px 0; }
.teacher-inventory-panel .teacher-inventory-controls label { min-width:0; width:100%; }
.teacher-inventory-panel .teacher-inventory-controls select,.teacher-inventory-panel .teacher-inventory-controls input { width:100%; min-width:0; }
.teacher-inventory-panel .teacher-inventory-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
.teacher-inventory-panel .revenue-share-strip { width:100%; }
.teacher-inventory-panel .revenue-share-strip span { width:auto; flex:1; }
@media(max-width:640px) { .teacher-inventory-panel .teacher-inventory-controls { grid-template-columns:1fr 1fr; } .teacher-inventory-panel .teacher-inventory-metrics { grid-template-columns:1fr 1fr; } .teacher-students-panel{padding:16px} }
