[hidden] {
  display: none !important;
}

.admin-body {
  min-height: 100vh;
  background: #f3f7f4;
  color: var(--ink);
}

.admin-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 86% 8%, rgba(201, 237, 153, 0.14), transparent 25%),
    radial-gradient(circle at 9% 92%, rgba(13, 138, 99, 0.08), transparent 27%);
  pointer-events: none;
}

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

.admin-sidebar {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 180;
  width: 268px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding: 24px 18px 19px;
  background:
    radial-gradient(circle at 40% 2%, rgba(201, 237, 153, 0.1), transparent 24%),
    linear-gradient(180deg, #123b32 0%, #0d3029 100%);
  color: #f5fbf8;
  box-shadow: -15px 0 50px rgba(18, 59, 50, 0.08);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 5px 34px;
}

.admin-brand .brand-mark {
  width: 45px;
  height: 45px;
  background: rgba(223, 246, 236, 0.13);
  color: var(--lime);
}

.admin-brand > span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.admin-brand strong {
  font-size: 16px;
}

.admin-brand small {
  margin-top: 3px;
  color: #a9c9bf;
  font-size: 10px;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-nav::before {
  content: "الإدارة";
  margin: 0 13px 9px;
  color: #7fa89c;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.admin-nav-item {
  width: 100%;
  min-height: 47px;
  display: grid;
  grid-template-columns: 27px 1fr auto;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 13px;
  padding: 9px 12px;
  background: transparent;
  color: #b8d0c9;
  cursor: pointer;
  text-align: right;
  font-size: 12px;
  transition: 0.18s ease;
}

.admin-nav-item > span:first-child {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.055);
  font-size: 15px;
}

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

.admin-nav-item.active {
  border-color: rgba(201, 237, 153, 0.12);
  background: rgba(223, 246, 236, 0.11);
  color: #fff;
  font-weight: 800;
}

.admin-nav-item.active > span:first-child {
  background: var(--lime);
  color: var(--forest);
}

.admin-nav-item b {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  padding: 0 6px;
  background: #fff;
  color: var(--forest);
  font-size: 9px;
}

.admin-sidebar-foot {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  padding: 18px 6px 0;
}

.admin-user-mini {
  display: grid;
  grid-template-columns: 37px 1fr;
  align-items: center;
  gap: 10px;
}

.admin-user-mini > span {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--mint);
  color: var(--forest);
  font-size: 13px;
  font-weight: 900;
}

.admin-user-mini div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

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

.admin-user-mini small {
  overflow: hidden;
  color: #8eb2a7;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-sidebar-foot > a {
  display: block;
  margin-top: 16px;
  color: #a7c4bb;
  font-size: 10px;
}

.admin-sidebar-foot > a:hover {
  color: var(--lime);
}

.admin-main {
  min-height: 100vh;
  margin-right: 268px;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(18, 59, 50, 0.08);
  padding: 11px clamp(20px, 3.7vw, 52px);
  background: rgba(247, 250, 248, 0.9);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.admin-topbar-title,
.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-topbar-title > div {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.admin-topbar-title small {
  color: #789089;
  font-size: 9px;
}

.admin-topbar-title strong {
  color: var(--forest);
  font-size: 14px;
}

.admin-menu-toggle {
  width: 42px;
  height: 42px;
  display: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.secure-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #d8e9e1;
  border-radius: 999px;
  padding: 7px 11px;
  background: #fff;
  color: #547068;
  font-size: 9px;
}

.secure-indicator i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(13, 138, 99, 0.1);
}

.admin-icon-button,
.admin-signout {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
}

.admin-icon-button {
  width: 40px;
  font-size: 20px;
  line-height: 1;
}

.admin-icon-button.loading {
  animation: admin-spin 0.8s linear infinite;
}

.admin-signout {
  padding: 7px 13px;
  color: #6a7e78;
}

.admin-icon-button:hover,
.admin-signout:hover {
  border-color: #b9d5c9;
  background: var(--mint-2);
}

.admin-content {
  width: min(1430px, 100%);
  margin-inline: auto;
  padding: clamp(27px, 4vw, 54px);
}

.access-gate {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.access-gate h1 {
  margin: 20px 0 6px;
  color: var(--forest);
  font-size: 23px;
}

.access-gate p {
  max-width: 470px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.access-gate .gate-actions {
  display: flex;
  gap: 9px;
  margin-top: 23px;
}

.access-gate .gate-actions a {
  border-radius: 12px;
  padding: 10px 16px;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.admin-loader {
  width: 42px;
  height: 42px;
  border: 3px solid #dce9e3;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: admin-spin 0.8s linear infinite;
}

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

.admin-view {
  animation: admin-reveal 0.28s ease both;
}

@keyframes admin-reveal {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 28px;
}

.admin-page-heading h1 {
  margin: 4px 0 5px;
  color: var(--forest);
  font-size: clamp(27px, 3.2vw, 39px);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.admin-page-heading p {
  margin: 0;
  color: #6a817a;
  font-size: 12px;
}

.admin-kicker {
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 900;
}

.last-updated {
  border-radius: 999px;
  padding: 7px 11px;
  background: #e8f3ee;
  color: #698179;
  font-size: 9px;
  white-space: nowrap;
}

.compact-heading {
  margin-bottom: 22px;
}

.compact-heading h1 {
  font-size: clamp(26px, 2.8vw, 35px);
}

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

.stat-card {
  position: relative;
  min-height: 142px;
  overflow: hidden;
  border: 1px solid #dfe9e4;
  border-radius: 19px;
  padding: 19px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 9px 30px rgba(18, 59, 50, 0.045);
}

.stat-card::after {
  content: "";
  position: absolute;
  width: 83px;
  height: 83px;
  left: -34px;
  bottom: -35px;
  border-radius: 50%;
  background: var(--stat-color, var(--mint));
  opacity: 0.38;
}

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-head span:first-child {
  color: #6b827b;
  font-size: 10px;
}

.stat-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--stat-color, var(--mint));
  color: var(--forest);
  font-size: 15px;
}

.stat-card strong {
  display: block;
  margin-top: 15px;
  color: var(--forest);
  font-size: 29px;
  line-height: 1;
}

.stat-card small {
  display: block;
  margin-top: 9px;
  color: #8a9b96;
  font-size: 9px;
}

.admin-card {
  border: 1px solid #dfe9e4;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 35px rgba(18, 59, 50, 0.045);
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.queue-card,
.activity-card {
  padding: 20px;
}

.activity-card {
  margin-top: 16px;
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 17px;
}

.card-heading > div {
  display: flex;
  flex-direction: column;
}

.card-heading span {
  color: #82968f;
  font-size: 9px;
}

.card-heading h2 {
  margin: 2px 0 0;
  color: var(--forest);
  font-size: 15px;
}

.card-heading > button {
  border: 0;
  padding: 5px;
  background: transparent;
  color: var(--green-dark);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

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

.queue-item {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 11px;
  border-top: 1px solid #edf1ef;
  padding: 13px 0;
}

.queue-item:first-child {
  border-top: 0;
  padding-top: 4px;
}

.queue-symbol {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--mint-2);
  color: var(--green-dark);
  font-size: 15px;
  font-weight: 900;
}

.queue-item > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.queue-item strong {
  overflow: hidden;
  color: var(--forest);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-item small {
  margin-top: 2px;
  color: #7d908a;
  font-size: 9px;
}

.queue-item > button {
  border: 1px solid #d9e7e1;
  border-radius: 10px;
  padding: 7px 10px;
  background: #fff;
  color: var(--green-dark);
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
}

.audit-mini-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.audit-mini-item {
  border: 1px solid #e8eeeb;
  border-radius: 14px;
  padding: 13px;
  background: #fafcfb;
}

.audit-mini-item span {
  display: block;
  color: var(--forest);
  font-size: 10px;
  font-weight: 800;
}

.audit-mini-item small {
  display: block;
  margin-top: 6px;
  color: #84958f;
  font-size: 8px;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 215px;
  gap: 11px;
  margin-bottom: 14px;
}

.admin-toolbar.single-tool {
  grid-template-columns: minmax(260px, 570px);
}

.admin-search,
.admin-filter,
.inline-search {
  display: flex;
  align-items: center;
  border: 1px solid #dce8e2;
  border-radius: 13px;
  background: #fff;
}

.admin-search {
  gap: 9px;
  padding: 0 13px;
}

.admin-search > span {
  color: var(--green);
  font-size: 21px;
  transform: rotate(-16deg);
}

.admin-search input,
.admin-filter select,
.inline-search input {
  width: 100%;
  min-height: 45px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 10px;
}

.admin-filter {
  gap: 8px;
  padding: 0 12px;
}

.admin-filter span {
  flex: 0 0 auto;
  color: #7e918b;
  font-size: 9px;
}

.admin-filter select {
  cursor: pointer;
}

.table-card {
  overflow: hidden;
}

.section-table {
  margin-bottom: 18px;
}

.table-heading {
  margin: 0;
  border-bottom: 1px solid #e7eeea;
  padding: 17px 19px;
}

.inline-search {
  width: 210px;
  padding: 0 12px;
}

.inline-search input {
  min-height: 38px;
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
}

.admin-table th {
  border-bottom: 1px solid #e4ece8;
  padding: 12px 15px;
  background: #f7faf8;
  color: #71867f;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-table td {
  border-bottom: 1px solid #edf2ef;
  padding: 14px 15px;
  color: #526a64;
  font-size: 10px;
  vertical-align: middle;
}

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

.admin-table tbody tr:hover {
  background: #fbfdfc;
}

.cell-title {
  min-width: 150px;
  display: flex;
  flex-direction: column;
}

.cell-title strong {
  color: var(--forest);
  font-size: 11px;
}

.cell-title small {
  max-width: 270px;
  margin-top: 2px;
  overflow: hidden;
  color: #889a94;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-muted {
  color: #8a9b96;
  white-space: nowrap;
}

.status-chip,
.type-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
}

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

.status-pending,
.status-pending_review,
.status-new,
.status-planned {
  background: #fff2df;
  color: #a45f18;
}

.status-approved,
.status-published,
.status-active,
.status-completed,
.status-received,
.status-use_documented,
.status-pickup_confirmed,
.status-accepted {
  background: #e5f6ed;
  color: #087052;
}

.status-rejected,
.status-suspended,
.status-cancelled,
.status-withdrawn {
  background: #fdeaea;
  color: #a84040;
}

.status-draft,
.status-closed,
.status-matched {
  background: #edf1f0;
  color: #647873;
}

.type-chip {
  background: #edf5f1;
  color: #526f66;
}

.type-chip.demo {
  background: #f4efe1;
  color: #8a7950;
}

.table-actions {
  min-width: 132px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.table-action {
  min-height: 31px;
  border: 1px solid #dce7e2;
  border-radius: 9px;
  padding: 6px 9px;
  background: #fff;
  cursor: pointer;
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
}

.table-action.approve {
  border-color: #bfe0d1;
  background: #f0faf5;
  color: #087052;
}

.table-action.reject,
.table-action.suspend {
  border-color: #efd2d2;
  background: #fff8f8;
  color: #a33e3e;
}

.table-action.reactivate {
  border-color: #bfe0d1;
  color: #087052;
}

.table-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.empty-table {
  display: grid;
  place-items: center;
  padding: 45px 20px;
  text-align: center;
}

.empty-table > span {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--mint-2);
  color: var(--green);
  font-size: 18px;
}

.empty-table strong {
  margin-top: 10px;
  color: var(--forest);
  font-size: 12px;
}

.empty-table p {
  margin: 3px 0 0;
  color: #879892;
  font-size: 9px;
}

.audit-timeline {
  padding: 10px 20px 18px;
}

.audit-entry {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(170px, 1fr) minmax(160px, 0.8fr) auto;
  gap: 13px;
  border-bottom: 1px solid #edf2ef;
  padding: 15px 0;
}

.audit-entry:last-child {
  border-bottom: 0;
}

.audit-dot {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--mint);
  color: var(--green-dark);
  font-size: 9px;
  font-weight: 900;
}

.audit-entry div {
  display: flex;
  flex-direction: column;
}

.audit-entry strong {
  color: var(--forest);
  font-size: 10px;
}

.audit-entry small,
.audit-entry time {
  color: #83968f;
  font-size: 8px;
}

.audit-metadata {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-dialog {
  width: min(560px, calc(100% - 24px));
  max-width: none;
  border: 0;
  border-radius: 23px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(18, 59, 50, 0.25);
}

.admin-dialog::backdrop {
  background: rgba(8, 35, 29, 0.55);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.admin-dialog-panel {
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 23px;
  padding: 25px;
  background: #fff;
}

.admin-dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 15px;
}

.admin-dialog-head > div {
  display: flex;
  flex-direction: column;
}

.admin-dialog-head span {
  color: var(--green-dark);
  font-size: 9px;
  font-weight: 900;
}

.admin-dialog-head h2 {
  margin: 2px 0 0;
  color: var(--forest);
  font-size: 21px;
}

.admin-dialog-head button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 11px;
  background: #f0f5f2;
  cursor: pointer;
  font-size: 22px;
}

.review-summary {
  margin: 18px 0;
  border-right: 3px solid var(--green);
  border-radius: 12px 0 0 12px;
  padding: 12px 14px;
  background: #f6faf8;
}

.review-summary strong {
  display: block;
  color: var(--forest);
  font-size: 12px;
}

.review-summary span {
  display: block;
  margin-top: 3px;
  color: #71867f;
  font-size: 9px;
}

.review-note-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.review-note-field > span {
  color: #526a64;
  font-size: 10px;
  font-weight: 900;
}

.review-note-field textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #d8e5df;
  border-radius: 13px;
  padding: 12px;
  outline: none;
  background: #fbfdfc;
  color: var(--ink);
  font-size: 11px;
}

.review-note-field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(13, 138, 99, 0.08);
}

.review-note-field small {
  color: #879892;
  font-size: 8px;
}

.admin-dialog-actions {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}

.admin-action {
  min-height: 43px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 9px 17px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
}

.admin-action.primary {
  background: var(--green);
  color: #fff;
}

.admin-action.primary.danger {
  background: #ad4545;
}

.admin-action.secondary {
  border-color: #dce6e2;
  background: #fff;
}

.admin-action:disabled {
  cursor: wait;
  opacity: 0.65;
}

.admin-toast {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 500;
  max-width: min(410px, calc(100% - 32px));
  transform: translateY(140%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 16px;
  background: var(--forest);
  color: #fff;
  box-shadow: 0 18px 45px rgba(18, 59, 50, 0.24);
  font-size: 10px;
  opacity: 0;
  transition: 0.24s ease;
}

.admin-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.admin-sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 160;
  border: 0;
  background: rgba(8, 35, 29, 0.46);
}

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

  .audit-mini-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .admin-sidebar {
    transform: translateX(105%);
    transition: transform 0.25s ease;
  }

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

  .admin-main {
    margin-right: 0;
  }

  .admin-menu-toggle {
    display: grid;
  }

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

  .admin-content {
    padding: 30px 22px;
  }
}

@media (max-width: 680px) {
  .admin-sidebar {
    width: min(286px, 88vw);
  }

  .admin-topbar {
    min-height: 66px;
    padding: 9px 12px;
  }

  .admin-topbar-title small,
  .secure-indicator,
  .admin-signout {
    display: none;
  }

  .admin-content {
    padding: 25px 12px 42px;
  }

  .admin-page-heading {
    align-items: start;
    flex-direction: column;
  }

  .admin-page-heading h1 {
    font-size: 27px;
  }

  .admin-stats {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .stat-card {
    min-height: 126px;
    padding: 15px;
  }

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

  .admin-toolbar {
    grid-template-columns: 1fr;
  }

  .queue-card,
  .activity-card {
    padding: 16px;
  }

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

  .inline-search {
    width: 100%;
  }

  .audit-entry {
    grid-template-columns: 22px 1fr;
  }

  .audit-entry > *:nth-child(n + 3) {
    grid-column: 2;
  }

  .admin-dialog-panel {
    padding: 20px 16px;
  }

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

  .admin-action {
    width: 100%;
  }

  .admin-toast {
    right: 16px;
    left: 16px;
    bottom: 16px;
    max-width: none;
  }
}

@media (max-width: 430px) {
  .admin-stats {
    grid-template-columns: 1fr;
  }
}
