/*!
 * Nitron UI Skeleton — pruned from NitronPay admin.css
 * Domain styles removed: payment timeline/inquiry, plugins catalog, DevMigrate
 */
/*!
 * NitronPay admin — lightweight Gentelella-inspired RTL layout
 */
:root,
html[data-theme="light"] {
  --np-bg: #f7f7f7;
  --np-sidebar: #2a3f54;
  --np-sidebar-text: #e7e7e7;
  --np-accent: #1abb9c;
  --np-top: #ededed;
  --np-card: #fff;
  --np-border: #e6e9ed;
  --np-text: #73879c;
  --np-dark: #2a3f54;
  --np-table-head: #fafafa;
  --np-input-bg: #fff;
  --np-input-border: #ccd0d4;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
  color-scheme: light;
}

html[data-theme="dark"] {
  --np-bg: #1a1d21;
  --np-sidebar: #111418;
  --np-sidebar-text: #c9d1d9;
  --np-accent: #1abb9c;
  --np-top: #22262b;
  --np-card: #24292f;
  --np-border: #30363d;
  --np-text: #adbac7;
  --np-dark: #e6edf3;
  --np-table-head: #1c2128;
  --np-input-bg: #1c2128;
  --np-input-border: #30363d;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, .28), 0 1px 2px rgba(0, 0, 0, .2);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    --np-bg: #1a1d21;
    --np-sidebar: #111418;
    --np-sidebar-text: #c9d1d9;
    --np-accent: #1abb9c;
    --np-top: #22262b;
    --np-card: #24292f;
    --np-border: #30363d;
    --np-text: #adbac7;
    --np-dark: #e6edf3;
    --np-table-head: #1c2128;
    --np-input-bg: #1c2128;
    --np-input-border: #30363d;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, .28), 0 1px 2px rgba(0, 0, 0, .2);
    color-scheme: dark;
  }
}

@media (prefers-color-scheme: light) {
  html[data-theme="system"] {
    --np-bg: #f7f7f7;
    --np-sidebar: #2a3f54;
    --np-sidebar-text: #e7e7e7;
    --np-accent: #1abb9c;
    --np-top: #ededed;
    --np-card: #fff;
    --np-border: #e6e9ed;
    --np-text: #73879c;
    --np-dark: #2a3f54;
    --np-table-head: #fafafa;
    --np-input-bg: #fff;
    --np-input-border: #ccd0d4;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { direction: rtl; }
body {
  margin: 0;
  font-family: var(--np-font, "Vazirmatn", Tahoma, "Segoe UI", sans-serif);
  background: var(--np-bg);
  color: var(--np-text);
  font-size: 14px;
}

a { color: var(--np-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.np-wrap { display: flex; min-height: 100vh; }
.np-sidebar {
  width: 230px;
  background: var(--np-sidebar);
  color: var(--np-sidebar-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  z-index: 200;
}
.np-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.np-sidebar .brand {
  padding: 18px 16px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}
.np-sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--np-sidebar-text);
  cursor: pointer;
}
.np-sidebar-close:hover { background: rgba(255,255,255,.08); color: #fff; }
.np-sidebar-backdrop {
  display: none;
}
.np-sidebar nav { flex: 1; overflow-y: auto; padding-bottom: 16px; }
.np-sidebar-foot {
  display: none;
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.np-sidebar-logout {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  background: rgba(231, 76, 60, .12);
  color: #ff8a80;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.np-sidebar-logout:hover {
  background: rgba(231, 76, 60, .22);
  color: #fff;
}
.np-sidebar nav a {
  display: block;
  padding: 12px 18px;
  color: var(--np-sidebar-text);
  border-right: 3px solid transparent;
}
.np-sidebar nav a:hover,
.np-sidebar nav a.active {
  background: rgba(255,255,255,.06);
  color: #fff;
  border-right-color: var(--np-accent);
  text-decoration: none;
}
.np-sidebar-form {
  margin: 8px 14px 12px;
}
.np-sidebar-nav-btn {
  display: block;
  width: 100%;
  padding: 12px 18px;
  border: 0;
  border-right: 3px solid transparent;
  background: transparent;
  color: var(--np-sidebar-text);
  font-family: inherit;
  font-size: inherit;
  text-align: right;
  cursor: pointer;
}
.np-sidebar-nav-btn:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
  border-right-color: var(--np-accent);
}
.np-sidebar-cache-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  width: 100%;
  padding: .7rem .9rem;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #1abb9c, #148f77);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  box-shadow: 0 4px 14px rgba(26, 187, 156, .35);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
a.np-sidebar-cache-btn.is-active {
  filter: brightness(1.08);
  box-shadow: 0 6px 18px rgba(26, 187, 156, .5);
}
.np-sidebar-cache-btn:hover {
  filter: brightness(1.06);
  box-shadow: 0 6px 18px rgba(26, 187, 156, .45);
  transform: translateY(-1px);
}
.np-sidebar-cache-btn:active {
  transform: translateY(0);
  filter: brightness(.96);
}
.np-sidebar-cache-btn svg {
  flex-shrink: 0;
  opacity: .95;
}
.np-sidebar .nav-section {
  padding: 14px 18px 6px;
  font-size: 11px;
  opacity: .55;
  text-transform: uppercase;
}

.np-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.np-topnav {
  background: var(--np-top);
  border-bottom: 1px solid var(--np-border);
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 52px;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 80;
}
.np-topnav-start {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.np-topnav-title {
  font-weight: 600;
  color: var(--np-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 1px solid var(--np-border);
  border-radius: 10px;
  background: var(--np-card);
  color: var(--np-dark);
  cursor: pointer;
  padding: 0;
}
.np-menu-btn:hover { border-color: var(--np-accent); color: var(--np-accent); }
.np-logout-form { display: inline; margin: 0; }
.np-content { padding: 20px; }
.np-footer {
  padding: 12px 20px;
  color: var(--np-text);
  font-size: 12px;
  border-top: 1px solid var(--np-border);
  opacity: .85;
}

/* Mobile bottom nav (PWA-style) — desktop hidden */
.np-mobile-nav {
  display: none;
}
.np-page-title {
  margin: 0 0 16px;
  color: var(--np-dark);
  font-size: 22px;
}

.np-card {
  background: var(--np-card);
  border: 1px solid var(--np-border);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}
.np-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.np-stat {
  background: var(--np-card);
  border: 1px solid var(--np-border);
  border-radius: 6px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.np-stat::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: var(--np-accent);
  opacity: .85;
}
.np-stat--primary::before { background: #3498db; }
.np-stat--accent::before { background: var(--np-accent); }
.np-stat--success::before { background: #26b99a; }
.np-stat--danger::before { background: #e74c3c; }
.np-stat .label { font-size: 12px; margin-bottom: 8px; }
.np-stat .value { font-size: 22px; color: var(--np-dark); font-weight: 700; letter-spacing: .2px; }

.np-dashboard-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 1fr;
  gap: 14px;
}
.np-chart-card { margin-bottom: 0; min-height: 280px; }
.np-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  gap: 8px;
}
.np-chart-head h3 {
  margin: 0;
  color: var(--np-dark);
  font-size: 15px;
}
.np-chart-hint { font-size: 11px; opacity: .7; }
.np-chart-wrap { position: relative; height: 220px; }
.np-chart-wrap--donut { height: 230px; }

.np-alert {
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.7;
  border: 1px solid var(--np-border);
  background: var(--np-card);
  color: var(--np-dark);
}
.np-alert--warning {
  border-color: rgba(243, 156, 18, .45);
  background: rgba(243, 156, 18, .12);
}
.np-alert a { font-weight: 700; }

.np-progress {
  height: 8px;
  background: var(--np-border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 6px;
  max-width: 220px;
}
.np-progress__bar {
  height: 100%;
  border-radius: 99px;
  background: #26b99a;
  transition: width .25s ease;
}
.np-progress__bar--warning { background: #f39c12; }
.np-progress__bar--over { background: #e74c3c; }
.np-progress__bar--ok { background: #26b99a; }
.np-progress__bar--unlimited { background: #73879c; }
.np-cap-meta { font-size: 12px; color: var(--np-dark); }
.np-cap-pct { font-size: 11px; opacity: .7; margin-top: 3px; }
.np-cap-row--over td { background: rgba(231, 76, 60, .06); }
.np-cap-row--warning td { background: rgba(243, 156, 18, .06); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--np-border);
  text-align: right;
  vertical-align: middle;
}
.table th { background: var(--np-table-head); color: var(--np-dark); font-weight: 600; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; color: var(--np-dark); }
.form-control, .form-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--np-input-border);
  border-radius: 3px;
  background: var(--np-input-bg);
  color: var(--np-dark);
  font-family: inherit;
}
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--np-accent);
  box-shadow: 0 0 0 2px rgba(26,187,156,.15);
}

.btn {
  display: inline-block;
  padding: 8px 14px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
}
.btn-primary { background: var(--np-accent); color: #fff; }
.btn-secondary { background: #73879c; color: #fff; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-link { background: transparent; color: var(--np-accent); }

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 11px;
  color: #fff;
}
.bg-success { background: #26b99a; }
.bg-danger { background: #e74c3c; }
.bg-secondary { background: #73879c; }
.bg-info { background: #3498db; }
.bg-warning { background: #f39c12; color: #fff; }

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.filter-actions { display: flex; gap: 8px; align-items: end; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  border-right: 3px solid var(--np-accent);
  padding: 10px 14px;
  margin-bottom: 10px;
  background: var(--np-table-head);
}
.timeline li.fail { border-right-color: #e74c3c; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #2a3f54, #1abb9c);
}
html[data-theme="dark"] .login-wrap {
  background: linear-gradient(135deg, #0f1419, #1a3d36);
}
html[data-theme="system"] .login-wrap {
  background: linear-gradient(135deg, #2a3f54, #1abb9c);
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .login-wrap {
    background: linear-gradient(135deg, #0f1419, #1a3d36);
  }
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--np-card);
  color: var(--np-text);
  padding: 32px 28px;
  border-radius: 10px;
  border: 1px solid var(--np-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .22);
}
.login-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.login-card h1 {
  margin: 0;
  color: var(--np-dark);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
}
.login-card > p,
.login-card .login-sub {
  margin: 0 0 22px;
  color: var(--np-text);
  font-size: 13.5px;
  line-height: 1.6;
}
.login-card .form-group label {
  color: var(--np-dark);
  font-size: 13px;
  font-weight: 600;
}
.login-card .form-control,
.login-card .form-select {
  background: var(--np-input-bg);
  border-color: var(--np-input-border);
  color: var(--np-dark);
}
.login-card .form-control::placeholder {
  color: var(--np-text);
  opacity: .75;
}
.login-card .np-switch-text {
  color: var(--np-dark);
}
.login-card .np-theme-toggle {
  flex: 0 0 auto;
  color: var(--np-dark);
  border-color: var(--np-border);
  background: var(--np-input-bg);
}
.login-alert {
  padding: 10px 12px;
  border-radius: 4px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.6;
}
.login-alert-error {
  background: rgba(231, 76, 60, .12);
  color: #c0392b;
  border: 1px solid rgba(231, 76, 60, .28);
}
.login-alert-success {
  background: rgba(26, 187, 156, .12);
  color: #148f77;
  border: 1px solid rgba(26, 187, 156, .28);
}
html[data-theme="dark"] .login-alert-error {
  color: #ff8a80;
}
html[data-theme="dark"] .login-alert-success {
  color: #7ddec8;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .login-alert-error { color: #ff8a80; }
  html[data-theme="system"] .login-alert-success { color: #7ddec8; }
}

.pagination { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.pagination li a, .pagination li span {
  display: block;
  padding: 6px 10px;
  border: 1px solid var(--np-border);
  background: var(--np-card);
  color: var(--np-dark);
}

/* Nitron pager */
.np-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--np-border);
  background:
    linear-gradient(135deg, rgba(26, 187, 156, .06), transparent 42%),
    var(--np-card);
}
.np-pager__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 12.5px;
  color: var(--np-text);
}
.np-pager__meta strong { color: var(--np-dark); font-weight: 700; }
.np-pager__badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(26, 187, 156, .14);
  color: #0f8f78;
  border: 1px solid rgba(26, 187, 156, .28);
}
.np-pager__badge--simple {
  background: rgba(243, 156, 18, .16);
  color: #c47d0a;
  border-color: rgba(243, 156, 18, .35);
}
.np-pager__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.np-pager__list li a,
.np-pager__list li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--np-border);
  background: var(--np-bg);
  color: var(--np-dark);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}
.np-pager__list li a:hover {
  border-color: var(--np-accent);
  color: var(--np-accent);
  transform: translateY(-1px);
}
.np-pager__list li.active span {
  background: linear-gradient(135deg, #1abb9c, #148f77);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 14px rgba(26, 187, 156, .28);
}
.np-pager__list li.disabled span {
  opacity: .45;
  cursor: not-allowed;
}

.np-settings-block-title {
  margin: 0 0 6px;
  color: var(--np-dark);
  font-size: 1.05rem;
}
.np-settings-block-desc {
  margin: 0 0 1.1rem;
  color: var(--np-text);
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .np-pager { padding: 10px; }
  .np-pager__list li a,
  .np-pager__list li span {
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    font-size: 12px;
  }
}

/* Gentelella-style single theme toggle */
.np-theme-toggle {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--np-text);
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background .15s ease, color .15s ease;
}
.np-theme-toggle:hover {
  background: var(--np-bg);
  color: var(--np-dark);
}
.np-theme-toggle .theme-icon-light,
.np-theme-toggle .theme-icon-dark {
  display: none;
  pointer-events: none;
}
/* light effective → show moon; dark effective → show sun */
html[data-theme="light"] .np-theme-toggle .theme-icon-dark { display: block; }
html[data-theme="dark"] .np-theme-toggle .theme-icon-light { display: block; }
@media (prefers-color-scheme: light) {
  html[data-theme="system"] .np-theme-toggle .theme-icon-dark { display: block; }
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .np-theme-toggle .theme-icon-light { display: block; }
}

.topnav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.np-admin-name {
  color: var(--np-dark);
  font-size: 13px;
}
.np-logout-btn {
  width: auto;
  min-height: 34px;
  padding: 0 10px !important;
  border-radius: 8px;
  color: var(--np-text) !important;
  text-decoration: none !important;
  transition: background .15s ease, color .15s ease;
}
.np-logout-btn:hover {
  background: var(--np-bg);
  color: var(--np-accent) !important;
}

/* Material-style row actions */
.np-card { overflow: visible; }
.np-actions-cell {
  width: 56px;
  text-align: center;
  white-space: nowrap;
  overflow: visible;
  position: relative;
  z-index: 1;
}
.np-table tbody tr:has(.np-action-menu.open),
.np-actions-cell:has(.np-action-menu.open) {
  position: relative;
  z-index: 10000;
}
.np-action-menu {
  position: relative;
  display: inline-flex;
  justify-content: center;
}
.np-action-menu.open { z-index: 10000; }
.np-action-trigger {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--np-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.np-action-trigger:hover {
  background: rgba(26, 187, 156, .12);
  color: var(--np-dark);
}
.np-action-menu.open .np-action-trigger {
  background: rgba(26, 187, 156, .18);
  color: var(--np-dark);
  box-shadow: inset 0 0 0 1px rgba(26, 187, 156, .25);
}
.np-action-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  min-width: 168px;
  padding: 8px;
  background: var(--np-card);
  border: 1px solid var(--np-border);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,.14), 0 4px 10px rgba(0,0,0,.08);
  z-index: 10050;
  isolation: isolate;
  opacity: 0;
  transform: scale(.96) translateY(-4px);
  transform-origin: top right;
  pointer-events: none;
  visibility: hidden;
  transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}
/* When portaled to body (JS), escape table stacking so other ⋯ icons cannot overlap */
.np-action-dropdown.is-ported,
body > .np-action-dropdown {
  position: fixed;
  z-index: 10050;
  isolation: isolate;
}
.np-action-menu.open .np-action-dropdown,
.np-action-dropdown.is-ported:not([hidden]) {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
  visibility: visible;
}
.np-action-menu.open .np-action-dropdown[hidden],
.np-action-dropdown.is-ported[hidden] {
  display: block;
}
.np-action-form {
  margin: 0;
}
.np-action-divider {
  height: 1px;
  margin: 6px 4px;
  background: var(--np-border);
}
.np-action-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--np-dark);
  font-size: 13px;
  font-family: inherit;
  text-align: right;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s ease;
  outline: none;
}
.np-action-item:hover,
.np-action-item:focus {
  background: rgba(26, 187, 156, .12);
  text-decoration: none;
  color: var(--np-dark);
}
.np-action-item svg {
  flex-shrink: 0;
  opacity: .75;
}
.np-action-danger {
  color: #c0392b;
}
.np-action-danger:hover,
.np-action-danger:focus {
  background: rgba(192, 57, 43, .1);
  color: #c0392b;
}
html[data-theme="dark"] .np-action-dropdown {
  box-shadow: 0 14px 32px rgba(0,0,0,.45), 0 4px 12px rgba(0,0,0,.3);
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .np-action-dropdown {
    box-shadow: 0 14px 32px rgba(0,0,0,.45), 0 4px 12px rgba(0,0,0,.3);
  }
}

/* Custom select — simple & theme-aware */
.np-select {
  position: relative;
  width: 100%;
}
.np-select-source {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
  inset-inline-start: 0;
  top: 0;
}
.np-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--np-input-border);
  border-radius: 8px;
  background: var(--np-input-bg);
  color: var(--np-dark);
  font-family: inherit;
  font-size: 13px;
  text-align: right;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.np-select-trigger:hover {
  border-color: var(--np-accent);
}
.np-select.open .np-select-trigger,
.np-select-trigger:focus {
  outline: none;
  border-color: var(--np-accent);
  box-shadow: 0 0 0 2px rgba(26, 187, 156, .15);
}
.np-select-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.np-select-label.is-placeholder {
  color: var(--np-text);
  opacity: .75;
}
.np-select-chevron {
  display: inline-flex;
  color: var(--np-text);
  transition: transform .15s ease;
  flex-shrink: 0;
}
.np-select.open .np-select-chevron {
  transform: rotate(180deg);
}
.np-select-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 55;
  max-height: 240px;
  overflow: auto;
  padding: 6px;
  background: var(--np-card);
  border: 1px solid var(--np-border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.06);
}
.np-select-option {
  width: 100%;
  display: block;
  padding: 9px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--np-dark);
  font-family: inherit;
  font-size: 13px;
  text-align: right;
  cursor: pointer;
}
.np-select-option:hover,
.np-select-option:focus {
  background: rgba(26, 187, 156, .12);
  outline: none;
}
.np-select-option.is-selected {
  background: rgba(26, 187, 156, .18);
  color: var(--np-accent);
  font-weight: 600;
}
.np-select-option.is-placeholder {
  opacity: .7;
}
.np-select.is-disabled .np-select-trigger {
  opacity: .55;
  cursor: not-allowed;
}
html[data-theme="dark"] .np-select-panel {
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .np-select-panel {
    box-shadow: 0 12px 30px rgba(0,0,0,.45);
  }
}

/* Confirm modal — theme tokens */
.rms-confirm-modal-container {
  top: 0;
  left: 0;
  z-index: 10000;
  background: rgba(15, 18, 22, .55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rms-confirm-modal {
  border-radius: 16px;
  min-width: 0;
  max-width: 320px;
  width: min(320px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--np-border);
  background: var(--np-card) !important;
  color: var(--np-dark) !important;
  box-shadow: 0 20px 48px rgba(0,0,0,.28);
  animation: modalSlideIn .28s ease-out;
}
.rms-confirm-modal .rms-confirm-body {
  padding: 22px 20px 20px;
}
.rms-confirm-modal .rms-confirm-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.rms-confirm-modal .rms-confirm-title {
  margin: 0 0 8px;
  color: var(--np-dark);
  font-size: 17px;
  font-weight: 700;
}
.rms-confirm-modal .rms-confirm-message {
  margin: 0;
  color: var(--np-text);
  font-size: 14px;
  line-height: 1.7;
}
.rms-confirm-modal .rms-confirm-desc {
  display: block;
  margin-top: 8px;
  color: var(--np-text);
  opacity: .8;
  font-size: 12px;
}
.rms-confirm-modal .rms-confirm-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  color: #fff;
}
.rms-confirm-modal .rms-confirm-icon svg {
  display: block;
}
.rms-confirm-modal .btn-outline-secondary {
  background: transparent;
  border: 1px solid var(--np-input-border);
  color: var(--np-dark);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.rms-confirm-modal .btn-outline-secondary:hover {
  background: var(--np-bg);
  border-color: var(--np-accent);
  color: var(--np-accent);
}
.rms-confirm-modal .btn-danger,
.rms-confirm-modal .btn-success,
.rms-confirm-modal .btn-warning,
.rms-confirm-modal .btn-primary {
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}
.rms-confirm-modal .btn-danger { background: #e74c3c; }
.rms-confirm-modal .btn-success { background: #26b99a; }
.rms-confirm-modal .btn-warning { background: #f39c12; }
.rms-confirm-modal .btn-primary { background: var(--np-accent); }

/* thin scrollbar (Gentelella-inspired) */
.np-main,
.np-content {
  scrollbar-width: thin;
  scrollbar-color: rgba(115, 135, 156, .45) transparent;
}
.np-main::-webkit-scrollbar,
.np-content::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.np-main::-webkit-scrollbar-thumb,
.np-content::-webkit-scrollbar-thumb {
  background: rgba(115, 135, 156, .45);
  border-radius: 99px;
}
.np-main::-webkit-scrollbar-track,
.np-content::-webkit-scrollbar-track {
  background: transparent;
}
.pagination li.active span { background: var(--np-accent); color: #fff; border-color: var(--np-accent); }

/* Toggle switch (theme-aware) — label.np-switch beats .form-group label { display:block } */
label.np-switch,
.np-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  margin: 0;
  margin-bottom: 0;
  color: var(--np-dark);
  font-size: 13px;
  line-height: 1.4;
  position: relative;
}
.np-switch-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}
.np-switch-track {
  position: relative;
  display: block;
  width: 44px;
  height: 24px;
  min-width: 44px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--np-input-border);
  border: 1px solid transparent;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .08);
  transition: background .2s ease, box-shadow .2s ease, border-color .2s ease;
  overflow: hidden;
}
.np-switch-thumb {
  position: absolute;
  top: 2px;
  right: 2px;
  left: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .22), 0 1px 1px rgba(0, 0, 0, .08);
  transition: transform .22s cubic-bezier(.4, 0, .2, 1), background .2s ease;
  transform: translateX(0);
}
.np-switch-input:checked + .np-switch-track {
  background: var(--np-accent);
  border-color: rgba(26, 187, 156, .35);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12), 0 0 0 3px rgba(26, 187, 156, .12);
}
.np-switch-input:checked + .np-switch-track .np-switch-thumb {
  transform: translateX(-22px);
  background: #fff;
}
.np-switch-input:focus-visible + .np-switch-track {
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 187, 156, .28);
}
.np-switch-input:checked:focus-visible + .np-switch-track {
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12), 0 0 0 3px rgba(26, 187, 156, .28);
}
.np-switch:hover .np-switch-track {
  filter: brightness(1.05);
}
.np-switch-input:disabled + .np-switch-track {
  opacity: .5;
  cursor: not-allowed;
}
.np-switch:has(.np-switch-input:disabled) {
  cursor: not-allowed;
  opacity: .7;
}
.np-switch-text {
  color: var(--np-dark);
}
html[data-theme="dark"] .np-switch-track {
  background: #3a424c;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .35);
}
html[data-theme="dark"] .np-switch-thumb {
  background: #e6edf3;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}
html[data-theme="dark"] .np-switch-input:checked + .np-switch-track {
  background: var(--np-accent);
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .np-switch-track {
    background: #3a424c;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .35);
  }
  html[data-theme="system"] .np-switch-thumb {
    background: #e6edf3;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
  }
  html[data-theme="system"] .np-switch-input:checked + .np-switch-track {
    background: var(--np-accent);
  }
}

/* helpers for confirm-modal */
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }
.text-center { text-align: center; }
.gap-2 { gap: .5rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: 1rem; }
.mt-2 { margin-top: .5rem; }
.mt-4 { margin-top: 1.5rem; }
.p-4 { padding: 1.25rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.fw-bold { font-weight: 700; }
.text-muted { color: var(--np-text); opacity: .85; }
.text-white { color: #fff; }
.btn-outline-secondary { background: transparent; border: 1px solid #ccd0d4; color: #73879c; padding: 8px 14px; border-radius: 3px; cursor: pointer; }
.rounded { border-radius: .5rem; }
.shadow-lg { box-shadow: 0 1rem 3rem rgba(0,0,0,.15); }
.position-fixed { position: fixed; }
.w-100 { width: 100%; }
.h-100 { height: 100%; }
.fs-1 { font-size: 2rem; }

@media (max-width: 1100px) {
  .np-dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .np-stats { grid-template-columns: 1fr 1fr; }
  .np-menu-btn { display: inline-flex; }
  .np-sidebar-close { display: inline-flex; }
  .np-sidebar-foot { display: block; }
  .np-admin-name { display: none; }
  .np-logout-btn { display: none; }

  .np-wrap { position: relative; }

  /* Off-canvas drawer (RTL: from right) */
  .np-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(300px, 86vw);
    transform: translateX(105%);
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
    box-shadow: none;
    overflow: hidden;
  }
  body.np-sidebar-open .np-sidebar {
    transform: translateX(0);
    box-shadow: -8px 0 32px rgba(0, 0, 0, .35);
  }
  .np-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 190;
    background: rgba(0, 0, 0, .48);
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s ease;
    backdrop-filter: blur(2px);
  }
  body.np-sidebar-open .np-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  body.np-sidebar-open {
    overflow: hidden;
  }

  .np-topnav { padding: 8px 12px; }
  .np-content {
    padding: 14px 12px 88px;
  }
  .np-footer { display: none; }
  .np-page-title { font-size: 18px; margin-bottom: 12px; }

  /* PWA-style sticky bottom bar */
  .np-mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding: 0 6px env(safe-area-inset-bottom, 0px);
    align-items: flex-end;
    justify-content: space-around;
    background: var(--np-card);
    border-top: 1px solid var(--np-border);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .12);
    overflow: visible;
  }
  html[data-theme="dark"] .np-mobile-nav {
    background: #1e2329;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, .4);
  }
  @media (prefers-color-scheme: dark) {
    html[data-theme="system"] .np-mobile-nav {
      background: #1e2329;
      box-shadow: 0 -8px 28px rgba(0, 0, 0, .4);
    }
  }
  .np-mobile-nav__item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    min-width: 0;
    height: 64px;
    padding: 6px 2px 8px;
    border: 0;
    background: transparent;
    color: var(--np-text);
    text-decoration: none;
    font-family: inherit;
    font-size: 10px;
    line-height: 1.2;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s ease;
  }
  .np-mobile-nav__item:hover,
  .np-mobile-nav__item:focus-visible {
    color: var(--np-accent);
    text-decoration: none;
    outline: none;
  }
  .np-mobile-nav__item.is-active {
    color: var(--np-accent);
  }
  .np-mobile-nav__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    transition: background .15s ease;
  }
  .np-mobile-nav__item.is-active .np-mobile-nav__icon {
    background: rgba(26, 187, 156, .14);
  }
  .np-mobile-nav__label {
    flex: 0 0 auto;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
  }
  .np-mobile-nav__item--main {
    overflow: visible;
  }
  .np-mobile-nav__fab {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    box-sizing: border-box;
    width: 48px;
    height: 48px;
    min-width: 48px;
    max-width: 48px;
    min-height: 48px;
    max-height: 48px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: var(--np-accent);
    color: #fff;
    box-shadow: 0 4px 14px rgba(26, 187, 156, .4);
    margin: -18px 0 2px;
    overflow: hidden;
    transform: none;
  }
  .np-mobile-nav__fab svg {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
  }
  .np-mobile-nav__item--main.is-active .np-mobile-nav__fab,
  .np-mobile-nav__item--main:active .np-mobile-nav__fab {
    box-shadow: 0 6px 18px rgba(26, 187, 156, .55);
  }
  .np-mobile-nav__item--main .np-mobile-nav__label {
    color: var(--np-accent);
  }

  /* Filter grids tighter on phones */
  .filter-row { grid-template-columns: 1fr 1fr; }
  .filter-actions { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .np-stats { grid-template-columns: 1fr; }
  .np-content { padding-left: 10px; padding-right: 10px; }
  .filter-row { grid-template-columns: 1fr; }
}
