:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #1c2b36;
  --muted: #6b7b87;
  --primary: #00bfa6;
  --brand-strong: #0a7f74;
  --brand-hover: #0b8f82;
  --brand-ink: #0b4f49;
  --focus-ring: #1e8d81;
  --motion-fast: 0.18s;
  --motion-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --lift-1: translateY(-1px);
  --lift-2: translateY(-2px);
  --border: #e4e9f0;
  --shadow: 0 12px 30px rgba(15, 35, 55, 0.08);
  --shadow-hover: 0 18px 36px rgba(15, 35, 55, 0.14);
}

[data-theme="dark"] {
  --bg: #0e1720;
  --card: #141f2a;
  --text: #e5eef6;
  --muted: #9db0c3;
  --primary: #00d5bb;
  --brand-strong: #12a092;
  --brand-hover: #17b3a3;
  --brand-ink: #c7f0ea;
  --focus-ring: #30c5b5;
  --border: #233445;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body.admin-body {
  font-family: "Manrope", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-secondary-color: var(--muted);
}

body.admin-body.admin-preload .admin-layout {
  opacity: 0;
}

.text-muted {
  color: var(--muted) !important;
}

.auth-wrapper {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 32px;
  align-items: center;
  padding: 40px;
}

.auth-card {
  background: var(--card);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.auth-visual {
  background: linear-gradient(120deg, rgba(0, 191, 166, 0.15), rgba(10, 80, 140, 0.1));
  border-radius: 24px;
  padding: 40px;
  min-height: 360px;
}

.brand {
  font-weight: 800;
  font-size: 1.35rem;
  margin-bottom: 8px;
}

.brand.brand-has-image {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
}

.brand.brand-has-image img {
  max-width: 150px;
  max-height: 34px;
  object-fit: contain;
  display: block;
}

.link {
  text-decoration: none;
  color: var(--primary);
}

.auth-footer {
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

.admin-layout.sidebar-collapsed {
  grid-template-columns: 86px 1fr;
}

.admin-layout.sidebar-collapsed .sidebar {
  width: 86px;
}

.sidebar {
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
}

.sidebar.collapsed {
  width: 86px;
}

.sidebar.collapsed .brand {
  display: none;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
}

.sidebar.collapsed .sidebar-nav .nav-link {
  justify-content: center;
  padding-left: 10px;
  padding-right: 10px;
}

.sidebar.collapsed .sidebar-nav .nav-link span {
  display: none;
}

.sidebar.collapsed .sidebar-footer {
  display: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-nav::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.sidebar-nav .nav-link.active,
.sidebar-nav .nav-link:hover {
  background: rgba(0, 191, 166, 0.12);
  color: var(--text);
}

.sidebar-footer {
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--muted);
}

.role-badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 191, 166, 0.15);
  color: var(--text);
  font-weight: 600;
  display: inline-block;
  margin-bottom: 6px;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

#mobileSidebar {
  display: none;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.search-box i {
  color: var(--muted);
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  color: var(--text);
}

.search-box input::placeholder {
  color: var(--muted);
}

.search-box.small {
  padding: 6px 10px;
  width: 220px;
}

.icon-btn {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  color: var(--text);
  cursor: pointer;
  border-radius: 10px;
  transition: background-color var(--motion-fast) var(--motion-ease), color var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease);
}

.icon-btn:hover,
.icon-btn:focus-visible {
  background: rgba(10, 127, 116, 0.14);
  color: var(--brand-ink);
  transform: var(--lift-1);
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: #ff5959;
  border-radius: 50%;
  position: absolute;
  top: 4px;
  right: 4px;
  display: none;
}

.badge-dot.is-visible {
  display: block;
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  font-weight: 600;
  color: var(--text) !important;
  border-radius: 10px;
  padding: 4px 8px;
  transition: background-color var(--motion-fast) var(--motion-ease), color var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease);
}

.profile-btn:hover,
.profile-btn:focus-visible {
  background: rgba(10, 127, 116, 0.14);
  color: var(--brand-ink);
  transform: var(--lift-1);
}

.profile-btn img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  background: var(--card);
  padding: 6px;
  z-index: 1200;
  min-width: 210px;
}

.dropdown-item {
  border-radius: 8px;
  color: var(--text) !important;
  transition: background-color var(--motion-fast) var(--motion-ease), color var(--motion-fast) var(--motion-ease);
}

.dropdown-item:hover,
.dropdown-item:focus-visible {
  background: rgba(10, 127, 116, 0.14);
  color: var(--brand-ink);
}

.settings-logo-preview {
  width: 120px;
  height: 120px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--bg);
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.settings-logo-preview.show {
  display: inline-flex;
}

.settings-logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.rk-settings-app {
  display: grid;
  gap: 16px;
}

.rk-settings-shell {
  display: grid;
  gap: 16px;
}

.rk-settings-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.rk-settings-dirty {
  font-size: 0.85rem;
  color: #f59e0b;
  font-weight: 600;
}

.rk-settings-tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rk-settings-tab {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 0.86rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rk-settings-tab.is-active {
  background: rgba(0, 191, 166, 0.16);
  border-color: rgba(0, 191, 166, 0.55);
}

.rk-settings-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  padding: 16px;
  display: grid;
  gap: 16px;
}

.rk-settings-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.rk-settings-panel-title {
  margin: 0;
  font-size: 1.1rem;
}

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

.rk-settings-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: var(--bg);
  display: grid;
  gap: 10px;
}

.rk-settings-card.is-full {
  grid-column: 1 / -1;
}

.rk-settings-field {
  display: grid;
  gap: 6px;
}

.rk-settings-label {
  font-weight: 600;
}

.rk-settings-help {
  font-size: 0.8rem;
  color: var(--muted);
}

.rk-settings-error {
  font-size: 0.78rem;
  color: #ef4444;
}

.rk-settings-input,
.rk-settings-select,
.rk-settings-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  padding: 9px 10px;
}

.rk-settings-input.is-invalid,
.rk-settings-select.is-invalid,
.rk-settings-textarea.is-invalid {
  border-color: #ef4444;
}

.rk-settings-textarea {
  min-height: 96px;
  resize: vertical;
}

.rk-switch {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #8ca0b5;
  transition: all var(--motion-fast) var(--motion-ease);
}

.rk-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.rk-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: all var(--motion-fast) var(--motion-ease);
}

.rk-switch:has(input:checked) {
  background: #10b981;
}

.rk-switch:has(input:checked)::after {
  left: 22px;
}

.rk-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rk-settings-plan-list {
  display: grid;
  gap: 10px;
}

.rk-settings-plan-item {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.rk-settings-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.rk-settings-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1300;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 10px 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease);
}

.rk-settings-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.rk-settings-logo-preview-img {
  margin-top: 8px;
  max-width: 220px;
  max-height: 70px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  padding: 6px;
}

@media (max-width: 992px) {
  .rk-settings-grid {
    grid-template-columns: 1fr;
  }
  .rk-settings-plan-item {
    grid-template-columns: 1fr;
  }
}

#contactMessagesTable tbody tr {
  cursor: pointer;
}

#contactMessagesTable tbody tr:hover {
  background: rgba(10, 127, 116, 0.08);
}

.contact-message-body {
  white-space: pre-wrap;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  padding: 12px;
}

input[type="file"].form-control {
  color: var(--text);
}

input[type="file"].form-control::file-selector-button {
  background: #e8eff7;
  color: #0f2c46;
  border: 1px solid #c5d3e3;
  border-radius: 8px;
  margin-right: 10px;
  padding: 0.36rem 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

input[type="file"].form-control::-webkit-file-upload-button {
  background: #e8eff7;
  color: #0f2c46;
  border: 1px solid #c5d3e3;
  border-radius: 8px;
  margin-right: 10px;
  padding: 0.36rem 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.content {
  padding: 24px;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 10px;
  flex-wrap: wrap;
}

.widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.widget-card {
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform var(--motion-fast) var(--motion-ease), box-shadow var(--motion-fast) var(--motion-ease), border-color var(--motion-fast) var(--motion-ease);
  border: 1px solid transparent;
}

.widget-card:hover,
.widget-card:focus-within {
  transform: var(--lift-1);
  box-shadow: var(--shadow-hover);
  border-color: var(--border);
}

.widget-title {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.widget-value {
  font-size: 1.6rem;
  font-weight: 700;
}

.widget-meta {
  font-size: 0.8rem;
}

.soft-card {
  border: none;
  border-radius: 18px;
  box-shadow: var(--shadow);
  background: var(--card);
  color: var(--text);
  --bs-card-bg: var(--card);
  --bs-card-color: var(--text);
  transition: transform var(--motion-fast) var(--motion-ease), box-shadow var(--motion-fast) var(--motion-ease), border-color var(--motion-fast) var(--motion-ease);
  border: 1px solid transparent;
}

.soft-card:hover,
.soft-card:focus-within {
  transform: var(--lift-1);
  box-shadow: var(--shadow-hover);
  border-color: var(--border);
}

.soft-card .card-body,
.soft-card h1,
.soft-card h2,
.soft-card h3,
.soft-card h4,
.soft-card h5,
.soft-card h6,
.soft-card p,
.stat-card {
  color: var(--text);
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.chart-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.metric-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(31, 126, 166, 0.08);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--border);
  --bs-table-hover-color: var(--text);
  --bs-table-striped-color: var(--text);
}

.table > :not(caption) > * > * {
  background-color: transparent !important;
  color: var(--text);
}

.table a {
  color: #6db5ff;
}

.table a:hover {
  color: #95ccff;
}

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.table-footer {
  display: flex;
  justify-content: flex-end;
}

.admin-body .btn {
  transition: background-color var(--motion-fast) var(--motion-ease), border-color var(--motion-fast) var(--motion-ease), color var(--motion-fast) var(--motion-ease), filter var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease);
}

.admin-body .btn:hover {
  transform: var(--lift-1);
}

.admin-body .btn:focus-visible,
.admin-body .icon-btn:focus-visible,
.admin-body .profile-btn:focus-visible,
.admin-body .user-action:focus-visible,
.admin-body .listing-action:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.admin-body .btn-outline-secondary:hover,
.admin-body .btn-outline-secondary:focus-visible {
  color: #ffffff !important;
  background: var(--brand-strong) !important;
  border-color: var(--brand-strong) !important;
}

.admin-body .btn-outline-warning:hover,
.admin-body .btn-outline-warning:focus-visible {
  color: #ffffff !important;
  background: #9a6413 !important;
  border-color: #9a6413 !important;
}

.admin-body .btn-outline-danger:hover,
.admin-body .btn-outline-danger:focus-visible {
  color: #ffffff !important;
  background: #a93131 !important;
  border-color: #a93131 !important;
}

.admin-body .btn-outline-success:hover,
.admin-body .btn-outline-success:focus-visible {
  color: #ffffff !important;
  background: var(--brand-strong) !important;
  border-color: var(--brand-strong) !important;
}

.admin-body .btn-outline-info:hover,
.admin-body .btn-outline-info:focus-visible {
  color: #ffffff !important;
  background: var(--brand-strong) !important;
  border-color: var(--brand-strong) !important;
}

.admin-body .btn-outline-primary:hover,
.admin-body .btn-outline-primary:focus-visible {
  color: #ffffff !important;
  background: var(--brand-hover) !important;
  border-color: var(--brand-hover) !important;
}

.admin-body .btn-outline-light:hover,
.admin-body .btn-outline-light:focus-visible {
  color: var(--brand-ink) !important;
  background: #d9efec !important;
  border-color: #d9efec !important;
}

#listings .page-header .btn {
  border-radius: 10px;
  font-weight: 700;
}

#listings .table-toolbar .form-control,
#listings .table-toolbar .form-select {
  min-height: 38px;
  border-radius: 10px;
}

#listings .table-responsive {
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 100%;
  overflow-x: auto;
}

#listingTable {
  margin-bottom: 0;
}

#listingTable thead th {
  font-weight: 700;
  white-space: nowrap;
  vertical-align: middle;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

#listingTable td {
  vertical-align: middle;
  white-space: nowrap;
  padding-top: 0.72rem;
  padding-bottom: 0.72rem;
}

#orders .orders-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(6, minmax(130px, 1fr));
  gap: 8px;
}

#payments .orders-filter-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) repeat(4, minmax(130px, 1fr));
  gap: 8px;
}

#paymentsTable th,
#paymentsTable td {
  white-space: nowrap;
  vertical-align: middle;
}

#paymentsTable th:last-child,
#paymentsTable td:last-child {
  min-width: 220px;
}

.payment-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.56rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: capitalize;
}

.payment-status-pill.pending { background: rgba(245, 158, 11, 0.16); color: #92400e; }
.payment-status-pill.paid,
.payment-status-pill.completed { background: rgba(16, 185, 129, 0.16); color: #065f46; }
.payment-status-pill.refunded { background: rgba(59, 130, 246, 0.16); color: #1d4ed8; }
.payment-status-pill.failed,
.payment-status-pill.cancelled { background: rgba(239, 68, 68, 0.16); color: #991b1b; }

.payment-fraud-flag {
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.18rem 0.56rem;
}

.payment-fraud-flag.safe {
  background: rgba(34, 197, 94, 0.14);
  color: #166534;
}

.payment-fraud-flag.flagged {
  background: rgba(239, 68, 68, 0.16);
  color: #991b1b;
}

#orders .table-sort-btn {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

#orders .table-sort-btn:hover,
#orders .table-sort-btn:focus-visible {
  color: var(--brand-strong);
}

#orderTable th,
#orderTable td {
  white-space: nowrap;
  vertical-align: middle;
}

#orderTable th:last-child,
#orderTable td:last-child {
  min-width: 280px;
}

.order-actions-scroll {
  display: flex;
  gap: 0.42rem;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.order-actions-scroll .btn {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 9px;
  padding: 0.3rem 0.55rem;
}

.order-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  max-width: 100%;
}

.order-quick-actions .order-promotion-duration {
  min-width: 110px;
  max-width: 130px;
  flex: 1 1 110px;
}

.order-quick-actions .btn {
  flex: 0 0 auto;
}

.categories-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.category-tree {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.category-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  background: rgba(31, 126, 166, 0.05);
}

.category-row.drag-over {
  border-color: var(--brand-strong);
  background: rgba(10, 127, 116, 0.14);
}

.category-row-main {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.category-row-main[data-cat-toggle] {
  cursor: pointer;
}

.category-children {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.category-toggle-btn,
.category-drag-handle {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 8px;
  min-width: 30px;
  min-height: 30px;
  line-height: 1;
  color: var(--text);
}

.category-icon-preview {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  object-fit: cover;
}

.category-icon-empty {
  min-width: 56px;
  height: 32px;
  border-radius: 8px;
  border: 1px dashed var(--border);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(127, 150, 173, 0.1);
}

.category-name-input {
  min-width: 220px;
  width: min(360px, 42vw);
}

.category-meta-text {
  font-size: 0.76rem;
  color: var(--muted);
}

.category-inline-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  flex: 1 1 320px;
}

.category-active-toggle {
  transform: scale(1.08);
}

.category-count-badge {
  font-size: 0.72rem;
  font-weight: 700;
}

@media (max-width: 1400px) {
  .category-name-input {
    width: min(320px, 52vw);
  }
}

@media (max-width: 992px) {
  .category-inline-actions {
    flex-wrap: wrap;
    flex: 1 1 100%;
  }
}

.reports-filters-sticky {
  position: sticky;
  top: 78px;
  z-index: 5;
}

.moderation-stat {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.moderation-stat h6 {
  margin-bottom: 8px;
}

.moderation-stat-high {
  border-color: #fca5a5;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.12) inset;
}

.moderation-stat-resolved {
  border-color: #86efac;
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.12) inset;
}

.status-badge,
.priority-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 600;
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.18);
  color: #92400e;
}

.status-badge.reviewing {
  background: rgba(250, 204, 21, 0.22);
  color: #854d0e;
}

.status-badge.resolved {
  background: rgba(34, 197, 94, 0.2);
  color: #166534;
}

.status-badge.rejected {
  background: rgba(148, 163, 184, 0.22);
  color: #334155;
}

.priority-chip.high {
  background: rgba(239, 68, 68, 0.18);
  color: #991b1b;
}

.priority-chip.medium {
  background: rgba(245, 158, 11, 0.18);
  color: #92400e;
}

.priority-chip.low {
  background: rgba(34, 197, 94, 0.16);
  color: #166534;
}

.report-actions-timeline {
  max-height: 240px;
  overflow: auto;
  display: grid;
  gap: 10px;
}

.report-actions-timeline .item {
  border-left: 2px solid var(--border);
  padding-left: 10px;
}

.category-row-main [data-field="slug"] {
  min-width: 200px;
  width: min(260px, 40vw);
}

.category-row-main [data-field="description"] {
  min-width: 260px;
  width: min(420px, 56vw);
}

.category-row-main [data-field="category_type"] {
  min-width: 130px;
  width: 140px;
}

#ordersPagination .btn {
  min-width: 86px;
}

@media (max-width: 1200px) {
  #orders .orders-filter-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
  #payments .orders-filter-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 768px) {
  #orders .orders-filter-grid {
    grid-template-columns: 1fr;
  }
  #payments .orders-filter-grid {
    grid-template-columns: 1fr;
  }
}

#listingTable th:nth-child(1),
#listingTable td:nth-child(1) {
  width: 44px;
}

#listingTable th:nth-child(2),
#listingTable td:nth-child(2) {
  min-width: 110px;
}

#listingTable th:nth-child(3),
#listingTable td:nth-child(3) {
  min-width: 230px;
  white-space: normal;
}

#listingTable th:nth-child(4),
#listingTable td:nth-child(4) {
  min-width: 130px;
}

#listingTable th:nth-child(5),
#listingTable td:nth-child(5) {
  min-width: 130px;
}

#listingTable th:nth-child(6),
#listingTable td:nth-child(6) {
  min-width: 110px;
}

#listingTable th:nth-child(7),
#listingTable td:nth-child(7) {
  min-width: 90px;
}

#listingTable th:nth-child(8),
#listingTable td:nth-child(8) {
  min-width: 130px;
}

#listingTable th:nth-child(9),
#listingTable td:nth-child(9) {
  min-width: 70px;
}

#listingTable th:nth-child(10),
#listingTable td:nth-child(10) {
  min-width: 420px;
  white-space: normal;
}

#listingTable .badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
}

.listing-actions-scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  align-items: center;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.user-inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.user-inline-toggle .badge {
  font-size: 0.74rem;
  font-weight: 700;
}

.user-inline-toggle .user-subscription-plan {
  min-width: 150px;
  font-size: 0.78rem;
  padding: 0.2rem 0.4rem;
  border-radius: 10px;
}

.user-actions-scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  align-items: center;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.user-actions-scroll::-webkit-scrollbar {
  height: 6px;
}

.user-actions-scroll::-webkit-scrollbar-thumb {
  background: rgba(120, 140, 165, 0.55);
  border-radius: 999px;
}

.user-action {
  min-height: 32px;
  line-height: 1.1;
  border-radius: 10px;
  padding: 0.36rem 0.64rem;
  font-size: 0.82rem;
  font-weight: 700;
  flex: 0 0 auto;
  white-space: nowrap;
  transition: background-color var(--motion-fast) var(--motion-ease), border-color var(--motion-fast) var(--motion-ease), color var(--motion-fast) var(--motion-ease), filter var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease);
}

.user-action:hover {
  transform: var(--lift-1);
}

.btn-user-ghost,
.btn-user-suspend,
.btn-user-danger,
.btn-user-warn {
  border: 1px solid transparent;
}

.btn-user-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-user-suspend {
  background: #9a5a19;
  border-color: #b9732f;
  color: #fff4e3;
}

.btn-user-danger {
  background: #b12f2f;
  border-color: #cb4a4a;
  color: #ffe9e9;
}

.btn-user-warn {
  background: #0f8a7c;
  border-color: #1ea595;
  color: #e8fffc;
}

.btn-user-ghost:hover {
  background: var(--brand-strong) !important;
  border-color: var(--brand-strong) !important;
  color: #ffffff !important;
}

.btn-user-suspend:hover,
.btn-user-danger:hover,
.btn-user-warn:hover {
  filter: brightness(1.06);
  color: #ffffff !important;
}

#users .page-header .btn {
  border-radius: 10px;
  font-weight: 700;
}

#users .page-header .btn-outline-secondary:hover {
  color: #ffffff;
  background: var(--brand-strong);
  border-color: var(--brand-strong);
}

#users .page-header .btn-outline-warning:hover {
  color: #ffffff;
  background: #9a6413;
  border-color: #9a6413;
}

#users .page-header .btn-outline-danger:hover {
  color: #ffffff;
  background: #a93131;
  border-color: #a93131;
}

#users .table-toolbar .form-control,
#users .table-toolbar .form-select,
#users .table-toolbar .search-box.small {
  min-height: 40px;
  border-radius: 12px;
}

#users #globalFollowSetting {
  border-radius: 12px;
}

#users #globalFollowSetting .badge {
  border-radius: 8px;
  font-weight: 700;
}

#users .table-responsive {
  border: 1px solid var(--border);
  border-radius: 12px;
}

#userTable {
  margin-bottom: 0;
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-striped-color: var(--text);
  --bs-table-hover-color: var(--text);
  --bs-table-border-color: var(--border);
}

#userTable thead th {
  font-weight: 700;
  white-space: nowrap;
  vertical-align: middle;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

#userTable td {
  vertical-align: middle;
  white-space: nowrap;
  padding-top: 0.72rem;
  padding-bottom: 0.72rem;
}

#userTable th:last-child,
#userTable td:last-child {
  min-width: 560px;
}

[data-theme="dark"] #users .soft-card {
  background: #0f1f33;
  border: 1px solid #24364b;
}

[data-theme="dark"] #users #globalFollowSetting {
  background: rgba(31, 126, 166, 0.12);
  border: 1px solid rgba(72, 133, 182, 0.35);
}

[data-theme="dark"] #users .table-toolbar .form-control,
[data-theme="dark"] #users .table-toolbar .form-select,
[data-theme="dark"] #users .table-toolbar .search-box.small {
  background: #0d1a2a;
  border-color: #29415a;
  color: #e5eef6;
}

[data-theme="dark"] #users .table-toolbar input::placeholder {
  color: #9db0c3;
}

[data-theme="dark"] .search-box,
[data-theme="dark"] .search-box.small {
  background: #0d1a2a;
  border-color: #29415a;
}

[data-theme="dark"] .search-box i {
  color: #9db0c3;
}

[data-theme="dark"] .search-box input {
  color: #e5eef6;
}

[data-theme="dark"] .search-box input::placeholder {
  color: #9db0c3;
}

[data-theme="dark"] #users .btn-user-ghost {
  color: #d9e6f3;
  border-color: #345070;
  background: rgba(31, 48, 70, 0.4);
}

[data-theme="dark"] #users .btn-user-ghost:hover {
  color: #ffffff;
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.admin-body .btn:disabled,
.admin-body .btn.disabled,
.user-action:disabled,
.listing-action:disabled {
  opacity: 1 !important;
  background: #e3e9f0 !important;
  border-color: #cdd7e3 !important;
  color: #7a8794 !important;
  cursor: not-allowed !important;
  transform: none !important;
  filter: none !important;
}

[data-theme="dark"] .admin-body .btn:disabled,
[data-theme="dark"] .admin-body .btn.disabled,
[data-theme="dark"] .user-action:disabled,
[data-theme="dark"] .listing-action:disabled {
  background: #2a3440 !important;
  border-color: #3a4758 !important;
  color: #9fb0c0 !important;
}

[data-theme="dark"] .widget-card {
  background: #102238;
  border: 1px solid #21364c;
}

[data-theme="dark"] .stat-card {
  background: #0d1c2f;
  border: 1px solid #22384e;
}

[data-theme="dark"] .search-box,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background: #0d1a2a;
  border-color: #29415a;
  color: #e5eef6;
}

[data-theme="dark"] .icon-btn:hover,
[data-theme="dark"] .icon-btn:focus-visible,
[data-theme="dark"] .profile-btn:hover,
[data-theme="dark"] .profile-btn:focus-visible {
  background: rgba(18, 160, 146, 0.28);
  color: #ffffff;
}

[data-theme="dark"] .profile-btn {
  color: #e5eef6 !important;
}

[data-theme="dark"] .dropdown-menu {
  background: #152434;
  border-color: #2b455d;
}

[data-theme="dark"] .dropdown-item {
  color: #d8e8f7 !important;
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus-visible {
  background: rgba(18, 160, 146, 0.26);
  color: #ffffff;
}

[data-theme="dark"] input[type="file"].form-control {
  color: #e5eef6;
}

[data-theme="dark"] input[type="file"].form-control::file-selector-button {
  background: #27405c;
  color: #f4fbff;
  border-color: #3d5b7c;
}

[data-theme="dark"] input[type="file"].form-control::-webkit-file-upload-button {
  background: #27405c;
  color: #f4fbff;
  border-color: #3d5b7c;
}

[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] input::placeholder {
  color: #9db0c3;
}

[data-theme="dark"] .btn-outline-secondary {
  color: #d5e6f7;
  border-color: #385474;
}

[data-theme="dark"] .btn-outline-secondary:hover {
  color: #ffffff;
  background: var(--brand-strong);
  border-color: var(--brand-hover);
}

[data-theme="dark"] .btn-outline-warning:hover,
[data-theme="dark"] .btn-outline-warning:focus-visible {
  color: #ffffff;
  background: #9f6b1d;
  border-color: #ba8331;
}

[data-theme="dark"] .btn-outline-danger:hover,
[data-theme="dark"] .btn-outline-danger:focus-visible {
  color: #ffffff;
  background: #ad3a3a;
  border-color: #ca5454;
}

[data-theme="dark"] .btn-outline-success:hover,
[data-theme="dark"] .btn-outline-success:focus-visible {
  color: #ffffff;
  background: var(--brand-strong);
  border-color: var(--brand-hover);
}

[data-theme="dark"] .btn-outline-info:hover,
[data-theme="dark"] .btn-outline-info:focus-visible {
  color: #ffffff;
  background: var(--brand-strong);
  border-color: var(--brand-hover);
}

[data-theme="dark"] .btn-outline-primary:hover,
[data-theme="dark"] .btn-outline-primary:focus-visible {
  color: #ffffff;
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.listing-actions-scroll::-webkit-scrollbar {
  height: 6px;
}

.listing-actions-scroll::-webkit-scrollbar-thumb {
  background: rgba(120, 140, 165, 0.55);
  border-radius: 999px;
}

.listing-action {
  min-height: 30px;
  line-height: 1.1;
  border-radius: 9px;
  padding: 0.32rem 0.55rem;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  flex: 0 0 auto;
  white-space: nowrap;
  transition: background-color var(--motion-fast) var(--motion-ease), border-color var(--motion-fast) var(--motion-ease), color var(--motion-fast) var(--motion-ease), filter var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease);
}

.listing-action:hover {
  transform: var(--lift-1);
}

.btn-listing-approve,
.btn-listing-feature,
.btn-listing-warn,
.btn-listing-reject,
.btn-listing-remove,
.btn-listing-danger {
  border: 1px solid transparent;
  font-weight: 600;
}

.btn-listing-approve {
  color: #eaf4ff !important;
  background: #1b4f87 !important;
  border-color: #2a67a8 !important;
}

.btn-listing-reject,
.btn-listing-warn {
  color: #ffe7c7 !important;
  background: #9a5a19 !important;
  border-color: #c77d2e !important;
}

.btn-listing-feature {
  color: #e5fffb !important;
  background: #0f8a7c !important;
  border-color: #20a999 !important;
}

.btn-listing-remove,
.btn-listing-danger {
  color: #ffe3e3 !important;
  background: #b12f2f !important;
  border-color: #d24e4e !important;
}

.btn-listing-approve:hover,
.btn-listing-feature:hover,
.btn-listing-warn:hover,
.btn-listing-reject:hover,
.btn-listing-remove:hover,
.btn-listing-danger:hover {
  filter: brightness(1.07);
  color: #ffffff !important;
}

.btn-listing-approve:focus,
.btn-listing-feature:focus,
.btn-listing-warn:focus,
.btn-listing-reject:focus,
.btn-listing-remove:focus,
.btn-listing-danger:focus {
  color: #ffffff !important;
}

.notification-panel {
  position: fixed;
  right: 24px;
  top: 80px;
  width: 320px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: none;
  flex-direction: column;
  z-index: 999;
  transition: transform var(--motion-fast) var(--motion-ease), box-shadow var(--motion-fast) var(--motion-ease), border-color var(--motion-fast) var(--motion-ease);
}

.notification-panel.open {
  display: flex;
}

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

.panel-header h6 {
  margin: 0;
  font-size: 1.05rem;
}

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-header-actions .btn {
  font-size: 0.75rem;
  line-height: 1.2;
  padding: 0.25rem 0.5rem;
}

.panel-body {
  padding: 12px 16px;
  display: grid;
  gap: 12px;
  max-height: min(62vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.notif-item {
  background: var(--bg);
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--text);
  font-size: 0.93rem;
  transition: transform var(--motion-fast) var(--motion-ease), background-color var(--motion-fast) var(--motion-ease), border-color var(--motion-fast) var(--motion-ease);
}

.notif-item strong {
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.2;
}

.notif-item p,
.notif-item small {
  color: var(--text-muted);
}

.notif-item p {
  margin: 0.2rem 0 0.15rem;
  font-size: 0.82rem;
  line-height: 1.28;
}

.notif-item small {
  font-size: 0.76rem;
}

.rbac-matrix-wrap {
  max-height: 340px;
}

.rbac-permissions-grid {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.rbac-permission-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.notif-item:hover,
.notif-item:focus-within {
  transform: var(--lift-1);
  border-color: var(--border);
  background: rgba(10, 127, 116, 0.12);
}

.stat-card {
  background: var(--bg);
  border-radius: 14px;
  padding: 16px;
  transition: transform var(--motion-fast) var(--motion-ease), box-shadow var(--motion-fast) var(--motion-ease), border-color var(--motion-fast) var(--motion-ease);
  border: 1px solid transparent;
}

.stat-card:hover,
.stat-card:focus-within {
  transform: var(--lift-1);
  box-shadow: var(--shadow-hover);
  border-color: var(--border);
}

@media (prefers-reduced-motion: reduce) {
  .admin-body .btn,
  .icon-btn,
  .profile-btn,
  .widget-card,
  .soft-card,
  .stat-card,
  .notif-item,
  .user-action,
  .listing-action,
  .notification-panel {
    transition: none !important;
    transform: none !important;
  }
}

@media (hover: none), (pointer: coarse) {
  .admin-body .btn:hover,
  .icon-btn:hover,
  .profile-btn:hover,
  .widget-card:hover,
  .soft-card:hover,
  .stat-card:hover,
  .notif-item:hover,
  .user-action:hover,
  .listing-action:hover {
    transform: none !important;
  }

  .widget-card:hover,
  .soft-card:hover,
  .stat-card:hover {
    box-shadow: var(--shadow) !important;
    border-color: var(--border) !important;
  }

  .notif-item:hover {
    background: var(--bg) !important;
    border-color: transparent !important;
  }
}

@media (max-width: 992px) {
  .admin-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }
  .sidebar {
    width: min(86vw, 320px);
    max-width: 320px;
    position: fixed;
    left: -100%;
    top: 0;
    height: 100vh;
    z-index: 999;
    transition: left 0.2s ease;
  }
  .sidebar.collapsed {
    width: min(86vw, 320px);
  }
  .sidebar .sidebar-header .icon-btn {
    display: none;
  }
  .sidebar.open {
    left: 0;
  }
  #mobileSidebar {
    display: inline-flex;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 10;
  }
  .auth-wrapper {
    grid-template-columns: 1fr;
  }
}


