:root,
[data-coreui-theme="light"] {
  --cui-primary: #0f766e;
  --cui-primary-rgb: 15, 118, 110;
  --cui-link-color: #0f766e;
  --cui-link-hover-color: #115e59;
  --cui-border-radius: 0.8rem;
  --cui-border-radius-sm: 0.6rem;
  --admin-ink: #0c1424;
  --admin-muted: #64748b;
  --admin-line: rgba(15, 23, 42, 0.08);
  --admin-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
  --admin-canvas: #f3f5fa;
}

html:not([data-coreui-theme="dark"]) body {
  background: var(--admin-canvas);
  color: #0f172a;
}

body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.011em;
}

.sidebar.sidebar-dark {
  --cui-sidebar-bg: #0c1424;
  --cui-body-bg: #0c1424;
  --cui-body-color: rgba(255, 255, 255, 0.78);
  --cui-emphasis-color: #fff;
  --cui-border-color: rgba(255, 255, 255, 0.06);
  --cui-sidebar-nav-gap: 0.25rem;
  --cui-sidebar-nav-link-border-radius: 0.75rem;
  --cui-sidebar-nav-link-color: rgba(255, 255, 255, 0.74);
  --cui-sidebar-nav-link-hover-bg: rgba(255, 255, 255, 0.06);
  --cui-sidebar-nav-link-hover-color: #fff;
  --cui-sidebar-nav-link-active-bg: rgba(45, 212, 191, 0.16);
  --cui-sidebar-nav-link-active-color: #fff;
  --cui-sidebar-nav-title-color: rgba(255, 255, 255, 0.38);
  --cui-sidebar-nav-link-icon-color: rgba(255, 255, 255, 0.7);
  box-shadow: 8px 0 30px rgba(8, 12, 24, 0.12);
}

.sidebar-header {
  min-height: 4.25rem;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: #fff;
  min-width: 0;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.65rem;
  display: grid;
  place-items: center;
  background: #134e4a;
  color: #5eead4;
  font-weight: 750;
  flex: 0 0 auto;
}

.brand-lockup strong {
  display: block;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #fff;
}

.brand-lockup em {
  display: block;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-nav .nav-link {
  font-weight: 600;
  gap: 0.15rem;
}

.sidebar-nav .nav-link.active {
  box-shadow: inset 3px 0 0 #2dd4bf;
}

.sidebar-nav .nav-icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

.sidebar-footer {
  justify-content: center;
}

.sidebar-toggler {
  --cui-sidebar-toggler-width: 1.35rem;
  --cui-sidebar-toggler-height: 1.35rem;
  --cui-sidebar-toggler-color: rgba(255, 255, 255, 0.72);
  margin-inline-start: 0;
}

.sidebar.sidebar-narrow .brand-lockup {
  justify-content: center;
}

.sidebar.sidebar-narrow .sidebar-brand-full,
.sidebar.sidebar-narrow .nav-label,
.sidebar.sidebar-narrow .nav-title {
  display: none !important;
}

.sidebar.sidebar-narrow .nav-link {
  justify-content: center;
}

.sidebar.sidebar-narrow .nav-icon {
  flex: 0 0 1.25rem;
  width: 1.25rem;
  margin: 0 !important;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-right: 0.35rem;
  color: #0f172a;
}

[data-coreui-theme="dark"] .menu-toggle {
  color: #f8fafc;
}

.header.header-sticky {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}

[data-coreui-theme="dark"] .header.header-sticky {
  background: rgba(15, 20, 28, 0.9);
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  padding-bottom: 0.85rem;
}

.page-heading__title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.header-nav .nav-link {
  border-radius: 999px;
  font-weight: 650;
}

.theme-switch {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  gap: 0.15rem;
}

[data-coreui-theme="dark"] .theme-switch {
  background: rgba(255, 255, 255, 0.06);
}

.theme-switch button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: inherit;
}

.theme-switch button.is-active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

[data-coreui-theme="dark"] .theme-switch button.is-active {
  background: #1e293b;
  color: #fff;
}

.icon-btn {
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  display: grid;
  place-items: center;
}

.icon-btn:hover {
  background: rgba(15, 23, 42, 0.06);
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  border: 0;
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 0.25rem 0.45rem 0.25rem 0.25rem;
}

.profile-chip:hover {
  background: rgba(15, 23, 42, 0.05);
}

.profile-chip__avatar {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #134e4a;
  color: #ccfbf1;
  font-size: 0.78rem;
  font-weight: 750;
}

.profile-chip__name {
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.1;
}

.profile-chip__role {
  font-size: 0.72rem;
  color: var(--admin-muted);
  text-transform: capitalize;
}

.dropdown-menu {
  border: 1px solid var(--admin-line);
  border-radius: 0.9rem;
  box-shadow: var(--admin-shadow);
  padding: 0.4rem;
  min-width: 14rem;
}

.dropdown-item {
  border-radius: 0.6rem;
  font-weight: 600;
}

.body {
  padding-bottom: 2rem;
}

.card {
  border: 1px solid var(--admin-line);
  border-radius: 1rem;
  box-shadow: var(--admin-shadow);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--admin-line);
  font-weight: 700;
  padding: 1rem 1.15rem;
  gap: 0.75rem;
}

.card-header .form-select {
  width: auto;
  min-width: 10rem;
  max-width: 100%;
}

.card-body {
  padding: 1.15rem;
}

.stat-card {
  height: 100%;
  overflow: hidden;
}

.stat-card .card-body {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.stat-card__icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.8rem;
  display: grid;
  place-items: center;
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  flex: 0 0 auto;
}

.stat-card__icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

.stat-card__label {
  color: var(--admin-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat-card__value {
  font-size: 1.55rem;
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.mix-card .mix {
  display: flex;
  height: 0.7rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
}

.mix__done { background: #0f766e; }
.mix__open { background: #38bdf8; }
.mix__other { background: #cbd5e1; }

.mix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  margin-top: 0.85rem;
  color: var(--admin-muted);
  font-size: 0.85rem;
  font-weight: 650;
}

.mix-legend i {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 99px;
  margin-right: 0.35rem;
}

.table {
  --cui-table-hover-bg: rgba(15, 118, 110, 0.05);
}

.table thead th {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 750;
  background: #f8fafc;
  white-space: nowrap;
}

[data-coreui-theme="dark"] .table thead th {
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.6);
}

.table td {
  vertical-align: middle;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.wrapper a {
  color: #0f766e;
}

.wrapper a:hover {
  color: #115e59;
}

.mono-link {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
  color: #0f766e;
}

.mono-link:hover {
  text-decoration: underline;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  background: #e2e8f0;
  color: #334155;
}

.status-badge--completed { background: #d1fae5; color: #065f46; }
.status-badge--in_progress { background: #dbeafe; color: #1e3a8a; }
.status-badge--abandoned { background: #f1f5f9; color: #475569; }

.form-control,
.form-select {
  border-radius: 0.75rem;
  min-height: 2.6rem;
}

.form-control:focus,
.form-select:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.16);
}

.btn {
  border-radius: 0.75rem;
  font-weight: 700;
}

.btn-primary {
  --cui-btn-bg: #0f766e;
  --cui-btn-border-color: #0f766e;
  --cui-btn-hover-bg: #115e59;
  --cui-btn-hover-border-color: #115e59;
  --cui-btn-active-bg: #134e4a;
  --cui-btn-active-border-color: #134e4a;
}

.btn-outline-primary {
  --cui-btn-color: #0f766e;
  --cui-btn-border-color: #0f766e;
  --cui-btn-hover-bg: #0f766e;
  --cui-btn-hover-border-color: #0f766e;
}

.btn-outline-danger {
  --cui-btn-color: #be123c;
  --cui-btn-border-color: #be123c;
  --cui-btn-hover-bg: #be123c;
  --cui-btn-hover-border-color: #be123c;
  --cui-btn-hover-color: #fff;
}

.alert {
  border: 0;
  border-radius: 0.9rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem 1rem;
}

.editor-list {
  display: flex;
  flex-direction: column;
}

.editor-row {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  border-top: 1px solid var(--admin-line);
}

.editor-row:first-child {
  border-top: 0;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85rem 1rem;
}

.editor-actions .form-order {
  width: 6.5rem;
}

.editor-actions .btn {
  margin-left: auto;
}

.editor-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.6rem;
  margin: 0;
  font-weight: 650;
}

.question-read {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.4;
}

.list-card {
  overflow: hidden;
}

.list-card__title {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.list-card__title em {
  display: inline-grid;
  place-items: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 750;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.4rem;
}

.order-badge {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 0.6rem;
  display: grid;
  place-items: center;
  background: #0f766e;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 750;
}

.person {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.person strong {
  display: block;
  line-height: 1.2;
}

.person__avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #134e4a, #0f766e);
  color: #ccfbf1;
  font-size: 0.78rem;
  font-weight: 750;
}

.data-table .role-pill {
  margin-top: 0;
}

.role-pill {
  display: inline-flex;
  margin-top: 0.2rem;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: capitalize;
  background: #e2e8f0;
  color: #334155;
}

.role-pill--admin { background: #ccfbf1; color: #115e59; }
.role-pill--manager { background: #e0e7ff; color: #3730a3; }
.role-pill--staff { background: #f1f5f9; color: #475569; }

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--admin-line);
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.04), transparent);
}

.pager__count {
  margin: 0;
  color: var(--admin-muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.pager__size {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  color: var(--admin-muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.pager__size select {
  height: 2.2rem;
  border: 1px solid var(--admin-line);
  border-radius: 0.7rem;
  background: #fff;
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0 0.55rem;
}

.pager__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.pager__nav button,
.pager__gap {
  min-width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--admin-line);
  border-radius: 0.7rem;
  background: #fff;
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0 0.7rem;
}

.pager__nav button:hover:not(:disabled) {
  border-color: #0f766e;
  color: #0f766e;
}

.pager__nav button.is-current {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

.pager__nav button:disabled {
  opacity: 0.45;
}

.pager__gap {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
}

[data-coreui-theme="dark"] .pager__nav button,
[data-coreui-theme="dark"] .pager__size select {
  background: #0f172a;
  color: #e2e8f0;
}

[data-coreui-theme="dark"] .role-pill--admin { background: rgba(45, 212, 191, 0.16); color: #99f6e4; }
[data-coreui-theme="dark"] .role-pill--manager { background: rgba(129, 140, 248, 0.18); color: #c7d2fe; }
[data-coreui-theme="dark"] .role-pill--staff { background: rgba(255, 255, 255, 0.08); color: #cbd5e1; }
[data-coreui-theme="dark"] .list-card__title em { background: rgba(45, 212, 191, 0.16); color: #99f6e4; }

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

@media (max-width: 575.98px) {
  .field-grid {
    grid-template-columns: 1fr;
  }
  .editor-actions .btn {
    margin-left: 0;
  }
}

.answer-item .answer-text {
  margin-top: 0.35rem;
  color: #334155;
  line-height: 1.5;
}

[data-coreui-theme="dark"] .answer-item .answer-text {
  color: rgba(255, 255, 255, 0.78);
}

.login-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 12% 18%, rgba(45, 212, 191, 0.28), transparent 32%),
    linear-gradient(145deg, #0c1424 0%, #134e4a 55%, #0f766e 100%);
}

.login-card {
  width: min(28rem, 100%);
  border: 0;
  border-radius: 1.25rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.login-card h1 {
  letter-spacing: -0.03em;
  font-weight: 750;
}

.data-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.data-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  background: #fff;
}

.data-table th {
  padding: 0.85rem 1.1rem;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  border-bottom: 1px solid #e8edf3;
  white-space: nowrap;
}

.data-table td {
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid #eef2f6;
  color: #475569;
  vertical-align: middle;
}

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

.data-table tbody tr:hover td {
  background: #f8fafc;
}

.data-table__code {
  color: #64748b;
  font-weight: 700;
  white-space: nowrap;
}

.data-table__name {
  color: #0f172a;
  font-weight: 650;
}

.data-table__actions {
  white-space: nowrap;
}

.data-table__empty {
  color: var(--admin-muted);
  text-align: center;
  padding: 1.5rem 1rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 750;
}

.status-pill--on {
  background: #dcfce7;
  color: #15803d;
}

.row-action {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  border-radius: 0.55rem;
  padding: 0.35rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 650;
}

.row-action + .row-action {
  margin-left: 0.45rem;
}

.row-action:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.row-action--danger:hover {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.editor-modal {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.editor-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.45);
}

.editor-modal__panel {
  position: relative;
  width: min(34rem, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.editor-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--admin-line);
}

.editor-modal__head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 750;
}

.editor-modal__body {
  padding: 1.15rem;
}

.editor-modal__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  align-items: end;
}

.editor-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

[data-coreui-theme="dark"] .data-table,
[data-coreui-theme="dark"] .editor-modal__panel {
  background: #0f172a;
}

[data-coreui-theme="dark"] .data-table th {
  background: #111827;
  color: #94a3b8;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-coreui-theme="dark"] .data-table td {
  color: #cbd5e1;
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-coreui-theme="dark"] .data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

[data-coreui-theme="dark"] .data-table__name,
[data-coreui-theme="dark"] .editor-modal__head h2 {
  color: #f8fafc;
}

[data-coreui-theme="dark"] .row-action {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}

[data-coreui-theme="dark"] .status-pill--on {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

@media (max-width: 991.98px) {
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  #sidebar.sidebar:not(.show) {
    margin-inline-start: -16rem !important;
    visibility: hidden;
  }

  #sidebar.sidebar.show {
    margin-inline-start: 0 !important;
    visibility: visible;
  }

  .wrapper {
    padding-inline: 0;
  }
}

@media (max-width: 575.98px) {
  .editor-modal__split {
    grid-template-columns: 1fr;
  }

  .data-table-head {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 575.98px) {
  .header .container-fluid {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
  .stat-card__value {
    font-size: 1.3rem;
  }
}
