:root {
  --app-bg: #f4f7f8;
  --surface: #ffffff;
  --surface-soft: #eef5f5;
  --border: #d7e1e3;
  --border-strong: #bdcacc;
  --text: #14202b;
  --muted: #60717c;
  --accent: #0f766e;
  --accent-soft: #dff4f1;
  --warning-soft: #fff3d7;
  --radius: 8px;
  --shadow: 0 10px 30px rgba(21, 38, 48, 0.06);
}

body {
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.08), transparent 30rem),
    var(--app-bg);
  color: var(--text);
  font-size: 15px;
}

a {
  color: #075ec9;
}

.app-navbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.app-brand {
  align-items: center;
  display: inline-flex;
  font-weight: 750;
  gap: 10px;
  letter-spacing: 0;
}

.brand-mark {
  background: linear-gradient(135deg, #0f766e, #29b6a8 55%, #f2b84b);
  border-radius: 7px;
  display: inline-block;
  height: 24px;
  width: 24px;
}

.user-role-badge {
  background: var(--accent-soft);
  border: 1px solid #bde4df;
  border-radius: 999px;
  color: #0f625c;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 8px 10px;
  white-space: nowrap;
}

.nav-icon-btn {
  align-items: center;
  display: inline-flex;
  gap: 7px;
}

.nav-icon-btn i {
  font-size: 12px;
}

.app-shell {
  padding: 28px clamp(16px, 2vw, 32px) 40px;
}

.page-header {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.header-actions form {
  margin: 0;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.page-title {
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  margin: 0;
}

.page-subtitle {
  color: var(--muted);
  font-size: 16px;
  margin: 8px 0 0;
}

.update-meta {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #41545f;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  margin-top: 14px;
  padding: 8px 11px;
}

.app-alert {
  border-radius: var(--radius);
  margin-bottom: 18px;
}

.refresh-status {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.13), rgba(255, 255, 255, 0.9)),
    #ffffff;
  border: 1px solid #8fcfc6;
  border-left: 6px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 18px 45px rgba(15, 118, 110, 0.14);
  color: #0f3d38;
  display: flex;
  gap: 18px;
  margin-bottom: 20px;
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
}

.refresh-status::after {
  animation: refresh-sheen 1.8s ease-in-out infinite;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  content: "";
  inset: 0 auto 0 -35%;
  position: absolute;
  width: 35%;
}

.refresh-status strong,
.refresh-status span {
  display: block;
  position: relative;
  z-index: 1;
}

.refresh-status strong {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 4px;
}

.refresh-copy {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.refresh-loader {
  align-items: center;
  background: var(--accent);
  border-radius: 999px;
  box-shadow: 0 0 0 8px rgba(15, 118, 110, 0.12);
  display: inline-flex;
  flex: 0 0 auto;
  height: 48px;
  justify-content: center;
  position: relative;
  width: 48px;
  z-index: 1;
}

.refresh-loader::before,
.refresh-loader::after,
.refresh-loader span {
  animation: refresh-pulse 1.1s ease-in-out infinite;
  background: #ffffff;
  border-radius: 999px;
  content: "";
  display: block;
  height: 8px;
  margin: 0 3px;
  width: 8px;
}

.refresh-loader::after {
  animation-delay: 0.22s;
}

.refresh-loader span {
  animation-delay: 0.11s;
}

.refresh-progress {
  background: rgba(15, 118, 110, 0.16);
  border-radius: 999px;
  height: 7px;
  margin-top: 14px;
  overflow: hidden;
  position: relative;
  width: min(420px, 100%);
  z-index: 1;
}

.refresh-progress span {
  animation: refresh-progress 1.15s ease-in-out infinite;
  background: linear-gradient(90deg, #0f766e, #29b6a8);
  border-radius: inherit;
  height: 100%;
  width: 42%;
}

.refresh-status.is-complete {
  background: #e8f8ee;
  border-color: #a8dfbd;
  color: #164b2d;
}

.refresh-status.is-failed {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #8f1d2c;
}

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

@keyframes refresh-pulse {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-7px);
  }
}

@keyframes refresh-progress {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(260%);
  }
}

@keyframes refresh-sheen {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(390%);
  }
}

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

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 112px;
  padding: 18px;
}

.stat-link {
  color: inherit;
  text-decoration: none;
}

.stat-link:hover {
  border-color: var(--accent);
  color: inherit;
  transform: translateY(-1px);
}

.stat span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 12px;
}

.stat strong {
  color: var(--text);
  display: block;
  font-size: 31px;
  font-weight: 800;
  line-height: 1;
}

.filter-bar {
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  margin-bottom: 18px;
  padding: 14px;
}

.filter-span-2 {
  grid-column: span 2;
}

.filter-span-3 {
  grid-column: span 3;
}

.filter-span-4 {
  grid-column: span 4;
}

.filter-actions {
  display: flex;
  gap: 10px;
}

.form-control,
.form-select,
.btn {
  border-radius: 7px;
}

.money-input {
  position: relative;
}

.money-input .form-control {
  padding-right: 38px;
}

.money-input span {
  color: var(--muted);
  font-weight: 750;
  pointer-events: none;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.btn-dark {
  background: #162026;
  border-color: #162026;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
}

.btn-primary:hover,
.btn-primary:focus {
  background: #0b5f59;
  border-color: #0b5f59;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.panel-heading {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-height: 52px;
  padding: 16px 20px;
}

.panel-heading strong {
  font-size: 17px;
  line-height: 1.2;
}

.panel-title {
  font-size: 15px;
  font-weight: 800;
  margin: 0;
}

.panel-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.pagination-bar {
  align-items: center;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 13px 16px;
}

.pagination-actions {
  display: flex;
  gap: 8px;
}

.table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
}

.table thead th {
  background: #f8fbfb;
  border-bottom: 1px solid var(--border);
  color: #394a55;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 12px 14px;
  text-transform: uppercase;
  white-space: nowrap;
}

.sort-link {
  align-items: center;
  color: inherit;
  display: inline-flex;
  gap: 6px;
  text-decoration: none;
}

.sort-link:hover,
.sort-link:focus,
.sort-link.is-active {
  color: var(--accent);
  text-decoration: none;
}

.sort-link span {
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--accent);
  display: inline-flex;
  font-size: 11px;
  height: 18px;
  justify-content: center;
  line-height: 18px;
  width: 18px;
}

.table tbody td {
  border-color: #e3eaeb;
  padding: 11px 14px;
  vertical-align: middle;
}

.table tbody tr:hover {
  background: #fbfdfd;
}

.entity-link {
  align-items: center;
  color: #18323a;
  display: inline-flex;
  font-weight: 750;
  gap: 8px;
  text-decoration: none;
}

.entity-link span {
  border-bottom: 1px solid transparent;
}

.entity-link::before {
  background: #dce9eb;
  border-radius: 999px;
  content: "";
  height: 7px;
  width: 7px;
}

.entity-link:hover,
.entity-link:focus {
  color: var(--accent);
  text-decoration: none;
}

.entity-link:hover span,
.entity-link:focus span {
  border-bottom-color: currentColor;
}

.table-action {
  align-items: center;
  background: #f3f7f8;
  border: 1px solid #d9e4e6;
  border-radius: 999px;
  color: #27444c;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 8px 10px;
  text-decoration: none;
  white-space: nowrap;
}

.table-action-icon {
  gap: 7px;
}

.table-action-icon i {
  font-size: 11px;
}

.table-action:hover,
.table-action:focus {
  background: var(--accent-soft);
  border-color: #bde4df;
  color: #0f625c;
  text-decoration: none;
}

.table-action-muted {
  background: transparent;
  color: var(--muted);
}

.provider-pill,
.type-pill,
.count-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  padding: 7px 9px;
  white-space: nowrap;
}

.provider-pill {
  background: var(--surface-soft);
  color: #24434a;
}

.provider-airalo {
  background: #fff0e6;
  color: #9a3e10;
}

.provider-holafly {
  background: #e5f8ef;
  color: #087047;
}

.provider-get-esim-travel {
  background: #eef7d8;
  color: #4f6f00;
}

.provider-nomad {
  background: #e9f0ff;
  color: #244ea8;
}

.provider-mobimatter {
  background: #efe9ff;
  color: #5a35a8;
}

.provider-ubigi {
  background: #e7f3ff;
  color: #006096;
}

.provider-saily {
  background: #ede9fe;
  color: #5b21b6;
}

.provider-alosim {
  background: #e5fbff;
  color: #007184;
}

.provider-maya-mobile {
  background: #e8f8ee;
  color: #216e3a;
}

.provider-jetpac {
  background: #fff1f2;
  color: #b42346;
}

.type-pill {
  background: var(--accent-soft);
  color: #0d625c;
}

.type-pill.limited {
  background: #edf1f3;
  color: #576872;
}

.count-pill {
  background: #eef1f3;
  color: #344650;
}

.price-cell {
  color: #111827;
  font-weight: 800;
  white-space: nowrap;
}

.muted-cell {
  color: var(--muted);
}

.side-list .list-group-item {
  align-items: center;
  border-color: #e3eaeb;
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
}

.side-list a {
  font-weight: 650;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.login-wrap {
  display: grid;
  min-height: calc(100vh - 120px);
  place-items: center;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: min(440px, 100%);
}

.login-mark {
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--accent);
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 18px;
  padding: 8px 11px;
}

.password-label-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 48px;
}

.password-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  display: inline-flex;
  font-size: 18px;
  height: 36px;
  justify-content: center;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
}

.password-toggle:hover,
.password-toggle:focus,
.password-toggle.is-visible {
  background: var(--surface-soft);
  color: var(--accent);
  outline: none;
}

.chart-wrap {
  min-height: 280px;
}

.user-create-form {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) auto;
  padding: 20px;
}

.user-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.user-actions form {
  margin: 0;
}

.status-pill {
  background: #eef1f3;
  border-radius: 999px;
  color: #344650;
  display: inline-flex;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  margin: 2px 4px 2px 0;
  padding: 7px 9px;
  white-space: nowrap;
}

.status-pill.is-superadmin {
  background: #fff4dd;
  color: #8a5b00;
}

.status-pill.is-active {
  background: #e8f8ee;
  color: #176137;
}

.status-pill.is-inactive {
  background: #f1f3f5;
  color: #687680;
}

.status-pill.is-pending {
  background: #e9f0ff;
  color: #244ea8;
}

.status-dot {
  background: #a8b4bb;
  border-radius: 999px;
  display: inline-block;
  height: 9px;
  margin-right: 7px;
  width: 9px;
}

.status-dot.is-online {
  background: #18a957;
  box-shadow: 0 0 0 4px rgba(24, 169, 87, 0.13);
}

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

  .filter-span-2,
  .filter-span-3,
  .filter-span-4 {
    grid-column: span 6;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding-inline: 12px;
  }

  .page-header {
    display: block;
  }

  .header-actions {
    align-items: stretch;
    flex-direction: column;
    margin-top: 14px;
  }

  .header-actions form {
    width: 100%;
  }

  .header-actions .btn {
    width: 100%;
  }

  .stat-grid,
  .filter-bar {
    grid-template-columns: 1fr;
  }

  .filter-span-2,
  .filter-span-3,
  .filter-span-4 {
    grid-column: auto;
  }

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

  .filter-actions .btn {
    width: 100%;
  }

  .pagination-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination-actions .btn {
    flex: 1;
  }

  .password-label-row {
    align-items: stretch;
    flex-direction: column;
  }

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