

.agent-page {
  color: #191c1e;
  min-width: 0;
}

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

.agent-page-topbar h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
}

.agent-page-topbar p {
  margin: 0;
  color: #555b6c;
  font-size: 18px;
}

.agent-page-actions {
  display: flex;
  gap: 20px;
  padding-top: 12px;
}

.agent-page-primary-btn,
.agent-page-outline-btn {
  min-width: 180px;
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 500;
}

.agent-detail-page-outline-btn {
  width: fit-content;
  min-width: 180px;
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 500;
  color: #191c1e;
  background: #ffffff80;
  border: 1px solid #c7c4d8;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.agent-detail-page-outline-btn svg {
  width: 18px;
  height: 18px;
}

.agent-page-primary-btn {
  color: #fff;
  background: #0052d6;
  box-shadow: 0 14px 28px rgba(0, 82, 214, 0.18);
}

.agent-page-outline-btn {
  color: #0052d6;
  border: 1px solid #0052d6;
  background: #fff;
}

.agent-page-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 32px;
}

.agent-page-stat-card,
.agent-page-card {
  background: #fff;
  border: 1px solid #edf1f7;
  border-radius: 20px;
  box-shadow: 0 14px 26px rgba(39, 66, 120, 0.08);
}

.agent-page-stat-card {
  min-height: 184px;
  padding: 24px;
}

.agent-page-icon {
  display: grid;
  place-items: center;
  width: 47px;
  height: 47px;
  border-radius: 10px;
  margin-bottom: 25px;
}

.agent-page-icon svg {
  width: 25px;
  height: 25px;
}

.agent-page-orange {
  color: #ff7a1a;
  background: #fff3e8;
}

.agent-page-green {
  color: #20c96b;
  background: #eafbf1;
}

.agent-page-cyan {
  color: #22c8b8;
  background: #e7fbf8;
}

.agent-page-purple {
  color: #9b5cff;
  background: #f6edff;
}

.agent-page-red {
  color: #ef4444;
  background: #ffeaea;
}

.agent-page-stat-card p {
  margin: 0 0 8px;
  color: #555b68;
  font-size: 14px;
}

.agent-page-stat-card strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.agent-page-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(210px, 1fr) minmax(300px, 1fr);
  gap: 26px;
  align-items: start;
}

.agent-page-card {
  padding: 24px;
}

.agent-page-card h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
}

.agent-page-overview {
  grid-column: 1 / 3;
  min-width: 0;
  min-height: 461px;
  padding-bottom: 28px;
  overflow: hidden;
}

.agent-page-agent-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 1fr);
  gap: 26px;
  margin-top: 24px;
  padding-bottom: 10px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(138, 154, 182, 0.65) transparent;
}

.agent-page-agent-strip::-webkit-scrollbar {
  height: 8px;
}

.agent-page-agent-strip::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(138, 154, 182, 0.65);
}

.agent-page-agent-strip::-webkit-scrollbar-track {
  background: transparent;
}

.agent-page-agent-card {
  min-height: 346px;
  padding: 24px;
  border: 1px solid #dfe6f1;
  border-radius: 12px;
  background: #fff;
}

.agent-page-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 8px 16px rgba(30, 46, 78, 0.15);
  flex-shrink: 0;
}

.agent-page-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.agent-page-agent-card h3 {
  margin: 8px 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.agent-page-agent-card > p {
  margin: 0;
  min-height: 18px;
  color: #6b7280;
  font-size: 13px;
}

.agent-page-agent-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
  padding-top: 23px;
  border-top: 1px solid #eef1f6;
}

.agent-page-agent-meta span {
  color: #374151;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 500;
}

.agent-page-agent-meta b {
  display: block;
  margin-top: 3px;
  font-size: 12px;
}

.agent-page-agent-card small {
  display: inline-grid;
  place-items: center;
  margin-top: 20px;
  padding: 4px 12px;
  border-radius: 6px;
  color: #059669;
  background: #ecfdf599;
  font-size: 11px;
  font-weight: 600;
}

.agent-page-agent-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}

.agent-page-agent-buttons button {
  padding: 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}

.agent-page-agent-buttons button:first-child {
  color: #374151;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.agent-page-agent-buttons button:last-child {
  color: #fff;
  background: #004aca;
}

.agent-page-wallet {
  grid-column: 3;
  min-height: 411px;
  padding: 24px;
  overflow: hidden;
}

.agent-page-activity-list {
  margin-top: 26px;
  max-height: 310px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(138, 154, 182, 0.65) transparent;
}

.agent-page-activity-list::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.agent-page-activity-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(138, 154, 182, 0.65);
}

.agent-page-activity-list::-webkit-scrollbar-track {
  background: transparent;
}

.agent-page-activity-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  min-width: 320px;
  border-bottom: 1px solid #eef1f6;
}

.agent-page-activity-item:last-child {
  border-bottom: 0;
}

.agent-page-trend {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.agent-page-trend svg {
  width: 19px;
  height: 19px;
}

.agent-page-trend.down {
  color: #dc2626;
  background: #dc262615;
}

.agent-page-trend.up {
  color: #10b981;
  background: #10b98115;
}

.agent-page-activity-item strong,
.agent-page-activity-item small {
  display: block;
}

.agent-page-activity-item strong {
  font-size: 14px;
}

.agent-page-activity-item small {
  margin-top: 4px;
  color: #9aa3b2;
  font-size: 12px;
}

.agent-page-activity-item p {
  margin: 0;
  text-align: right;
  font-size: 14px;
  font-weight: 800;
}

.agent-page-debit {
  color: #ff3b3f;
}

.agent-page-credit {
  color: #00b579;
}

.agent-page-quick {
  grid-column: 1;
  min-height: 508px;
  padding: 42px 24px 36px;
}

.agent-page-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.agent-page-quick-grid button {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 10px;
  min-height: 114px;
  padding: 20px;
  border-radius: 12px;
  color: #1a1a1a;
  background: #f5f7fb;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
}

.agent-page-quick-grid svg {
  width: 20px;
  height: 20px;
}

.agent-page-quick-grid button:nth-child(1) svg,
.agent-page-quick-grid button:nth-child(6) svg {
  color: #0052d6;
}

.agent-page-quick-grid button:nth-child(2) svg,
.agent-page-quick-grid button:nth-child(3) svg {
  color: #ff7a1a;
}

.agent-page-quick-grid button:nth-child(4) svg {
  color: #18cdbb;
}

.agent-page-quick-grid button:nth-child(5) svg {
  color: #20c96b;
}

.agent-page-performance {
  grid-column: 2;
  min-height: 506px;
  padding: 40px 30px;
}

.agent-page-bars {
  display: grid;
  gap: 26px;
  margin-top: 32px;
}

.agent-page-bars p {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 9px;
  font-size: 14px;
}

.agent-page-bars b {
  font-size: 15px;
}

.agent-page-bars span {
  display: block;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5e7eb;
}

.agent-page-bars i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #0052d6;
}

.agent-page-support {
  grid-column: 3;
  min-height: 578px;
  padding: 35px 30px;
}

.agent-page-notices {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.agent-page-notices div {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  min-height: 78px;
  padding: 18px 22px;
  border-radius: 10px;
  background: #f3f6fb;
}

.agent-page-notices span {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
}

.agent-page-notices .orange {
  background: #ff7a1a;
}

.agent-page-notices .red {
  background: #ef4444;
}

.agent-page-notices .violet {
  background: #8b5cf6;
}

.agent-page-notices .green {
  background: #22c58d;
}

.agent-page-notices p {
  margin: 0;
  color: #344054;
  font-size: 14px;
}

.agent-page-notices small {
  display: block;
  margin-top: 9px;
  color: #98a2b3;
  font-size: 11px;
}

@media (max-width: 1280px) {
  .agent-page-main-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.62fr);
  }

  .agent-page-overview,
  .agent-page-quick {
    grid-column: 1;
  }

  .agent-page-wallet,
  .agent-page-performance,
  .agent-page-support {
    grid-column: 2;
  }

  .agent-page-wallet,
  .agent-page-support {
    min-height: auto;
  }
}

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

  .agent-page-main-grid {
    grid-template-columns: 1fr;
  }

  .agent-page-overview,
  .agent-page-wallet,
  .agent-page-quick,
  .agent-page-performance,
  .agent-page-support {
    grid-column: 1;
  }
}

@media (max-width: 760px) {
  .agent-page-topbar {
    flex-direction: column;
  }

  .agent-page-topbar h1 {
    font-size: 26px;
  }

  .agent-page-topbar p {
    max-width: 100%;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }

  .agent-page-actions,
  .agent-page-agent-buttons,
  .agent-page-quick-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .agent-page-actions {
    display: grid;
    gap: 12px;
    padding-top: 0;
  }

  .agent-page-primary-btn,
  .agent-page-outline-btn {
    width: 100%;
    min-width: 0;
  }

  .agent-page-stats-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .agent-page-stat-card {
    min-height: 150px;
  }

  .agent-page-card {
    padding: 24px 18px;
  }

  .agent-page-agent-strip {
    grid-auto-columns: minmax(260px, 86vw);
    margin-right: -18px;
    padding-right: 18px;
  }

  .agent-page-agent-meta,
  .agent-page-activity-item {
    grid-template-columns: 1fr;
  }

  .agent-page-activity-item {
    gap: 10px;
    padding: 16px 0;
  }

  .agent-page-activity-item p {
    text-align: left;
  }
}

/* Sub agent management page */

.sub-agent-page-filter,
.sub-agent-page-table-card {
  background: #fff;
  border: 1px solid #edf1f7;
  border-radius: 20px;
  box-shadow: 0 14px 26px rgba(39, 66, 120, 0.08);
}

.sub-agent-page-filter {
  display: grid;
  grid-template-columns:
    minmax(200px, 1.18fr) minmax(150px, 0.68fr) minmax(150px, 0.56fr)
    minmax(200px, 0.72fr) 130px;
  gap: 17px;
  align-items: center;
  min-height: 104px;
  margin-bottom: 32px;
  padding: 24px;
}

.sub-agent-page-filter label {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.sub-agent-page-filter input,
.sub-agent-page-filter select {
  width: 100%;
  padding: 14px;
  border: 1px solid #d9e0eb;
  border-radius: 8px;
  outline: none;
  background: #f7f9fc;
  color: #4b5565;
  font-size: 14px;
}

.sub-agent-page-filter select {
  appearance: none;
}

.sub-agent-page-filter input::placeholder {
  color: #9aa4b5;
}

.sub-agent-page-search-field input,
.sub-agent-page-date-field input {
  padding-left: 52px;
}

.sub-agent-page-search-field svg,
.sub-agent-page-date-field svg {
  position: absolute;
  left: 18px;
  z-index: 1;
  width: 18px;
  height: 18px;
  color: #94a3b8;
}

.sub-agent-page-filter button {
  height: 50px;
  border-radius: 999px;
  color: #fff;
  background: #0052d6;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(0, 82, 214, 0.16);
}

.sub-agent-page-table-card {
  padding: 43px 30px 34px;
}

.sub-agent-page-table-card h2 {
  margin: 0 0 30px;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
}

.sub-agent-page-table-wrap {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(138, 154, 182, 0.65) transparent;
}

.sub-agent-page-table-wrap::-webkit-scrollbar {
  height: 8px;
}

.sub-agent-page-table-wrap::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(138, 154, 182, 0.65);
}

.sub-agent-page-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.sub-agent-page-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

.sub-agent-page-table thead {
  background: #f8fafc;
}

.sub-agent-page-table th {
  height: 54px;
  padding: 0 12px;
  color: #687386;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.sub-agent-page-table td {
  height: 96px;
  padding: 17px 12px;
  border-bottom: 1px solid #edf1f6;
  color: #303847;
  font-size: 13px;
  vertical-align: middle;
  white-space: nowrap;
}

.sub-agent-page-table tr:last-child td {
  border-bottom: 0;
}

.sub-agent-page-table a {
  color: #0052d6;
  font-weight: 700;
}

.sub-agent-page-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.sub-agent-page-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 8px 16px rgba(30, 46, 78, 0.15);
  flex-shrink: 0;
}

.sub-agent-page-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sub-agent-page-profile strong,
.sub-agent-page-profile small {
  display: block;
}

.sub-agent-page-profile strong {
  margin-bottom: 4px;
  color: #141924;
  font-size: 14px;
}

.sub-agent-page-profile small {
  max-width: 180px;
  overflow: hidden;
  color: #697386;
  font-size: 12px;
  text-overflow: ellipsis;
}

.sub-agent-page-kyc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.sub-agent-page-kyc svg {
  width: 13px;
  height: 13px;
}

.sub-agent-page-kyc.verified {
  color: #079669;
  background: #e6fbf1;
}

.sub-agent-page-kyc.rejected {
  color: #ef4444;
  background: #ffe4e4;
}

.sub-agent-page-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}

.sub-agent-page-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.sub-agent-page-status.active {
  color: #0f9f75;
}

.sub-agent-page-status.active::before {
  background: #0fbd88;
}

.sub-agent-page-status.suspended {
  color: #ef4444;
}

.sub-agent-page-status.suspended::before {
  background: #ef4444;
}

.bookings-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #0d55d8, #2563eb);
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 8px 20px rgba(13, 85, 216, 0.25);
}

.bookings-btn svg {
  width: 15px;
  height: 15px;
}

.bookings-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(13, 85, 216, 0.35);
}

.bookings-btn:active {
  transform: scale(0.97);
}

.sub-agent-page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 40px;
  padding: 0 46px;
}

.sub-agent-page-footer p {
  margin: 0;
  color: #303847;
  font-size: 13px;
}

.sub-agent-page-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sub-agent-page-pagination button {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #1f2937;
  background: #fff;
  font-size: 16px;
  font-weight: 600;
}

.sub-agent-page-pagination button.active {
  color: #fff;
  background: #0052d6;
  box-shadow: 0 10px 18px rgba(0, 82, 214, 0.22);
}

.sub-agent-page-pagination svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 1280px) {
  .sub-agent-page-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sub-agent-page-filter button {
    width: 160px;
  }

  .sub-agent-page-footer {
    margin-top: 60px;
  }
}

@media (max-width: 760px) {
  .sub-agent-page-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .sub-agent-page-filter {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px;
  }

  .sub-agent-page-filter button {
    width: 100%;
    min-width: 0;
  }

  .sub-agent-page-table-card {
    padding: 28px 18px 22px;
  }

  .sub-agent-page-table-card h2 {
    margin-bottom: 20px;
  }

  .sub-agent-page-footer {
    margin-top: 32px;
    padding: 0;
  }

  .sub-agent-page-pagination {
    justify-content: center;
  }
}

/* Add agent drawer */

body.agent-drawer-open,
body.agent-profile-open,
body.agent-edit-open,
body.agent-reset-open,
body.agent-suspend-open {
  overflow: hidden;
}

.agent-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.42);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.24s ease,
    visibility 0.24s ease;
}

.agent-drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  width: min(430px, 100vw);
  height: 100vh;
  color: #111827;
  background: #fff;
  box-shadow: -20px 0 45px rgba(15, 23, 42, 0.18);
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

body.agent-drawer-open .agent-drawer-overlay,
body.agent-profile-open .agent-drawer-overlay,
body.agent-edit-open .agent-drawer-overlay,
body.agent-reset-open .agent-drawer-overlay,
body.agent-suspend-open .agent-drawer-overlay {
  opacity: 1;
  visibility: visible;
}

body.agent-drawer-open .agent-drawer-panel {
  transform: translateX(0);
}

.agent-drawer-header {
  position: relative;
  min-height: 90px;
  padding: 28px 28px 50px;
  color: #fff;
  background: #0754d6;
}

.agent-drawer-header h2 {
  margin: 0 0 14px;
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
}

.agent-drawer-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
}

.agent-drawer-close {
  position: absolute;
  top: 25px;
  right: 24px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #fff;
  background: transparent;
}

.agent-drawer-close::before {
  content: "x";
  font-size: 17px;
  line-height: 1;
}

.agent-drawer-close svg {
  display: none;
}

.agent-drawer-body {
  flex: 1;
  min-height: 0;
  padding: 100px 28px 24px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(138, 154, 182, 0.65) transparent;
}

.agent-drawer-body::-webkit-scrollbar {
  width: 8px;
}

.agent-drawer-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(138, 154, 182, 0.65);
}

.agent-avatar-upload {
  position: absolute;
  top: 85px;
  left: 0;
  right: 0;
  z-index: 2;
  display: grid;
  justify-items: center;
  margin: 0;
}

.agent-avatar-camera {
  position: relative;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border: 5px solid #fff;
  border-radius: 50%;
  color: #8b95a5;
  background: #e5e7eb;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.agent-avatar-camera > svg {
  width: 28px;
  height: 28px;
}

.agent-avatar-camera span {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 3px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: #0754d6;
}

.agent-avatar-camera span svg {
  width: 12px;
  height: 12px;
}

.agent-avatar-upload p {
  margin: 10px 0 0;
  color: #8a94a6;
  font-size: 11px;
}

.agent-drawer-form {
  display: grid;
  gap: 28px;
}

.agent-form-section h3 {
  margin: 0 0 20px;
  padding-bottom: 13px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 15px;
  line-height: 1;
  font-weight: 800;
}

.agent-form-grid {
  display: grid;
  gap: 14px;
}

.agent-form-grid + .agent-form-grid {
  margin-top: 14px;
}

.agent-form-grid.one {
  grid-template-columns: 1fr;
}

.agent-form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.agent-form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.agent-form-grid label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.agent-form-grid span {
  color: #111827;
  font-size: 11px;
  font-weight: 600;
}

.agent-form-grid input,
.agent-form-grid select {
  width: 100%;
  min-width: 0;
  height: 43px;
  border: 1px solid #d8dee8;
  border-radius: 10px;
  outline: none;
  padding: 0 16px;
  color: #172033;
  background: #fff;
  font-size: 13px;
}

.agent-form-grid input::placeholder {
  color: #a2abba;
}

.agent-permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.agent-permission-grid label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 0 10px 0 14px;
  border-radius: 6px;
  color: #1f2937;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 500;
}

.agent-permission-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.agent-permission-grid label > span {
  position: relative;
  width: 42px;
  height: 22px;
  border-radius: 999px;
  background: #cbd5e1;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

.agent-permission-grid label > span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.agent-permission-grid input:checked + span {
  background: #0754d6;
}

.agent-permission-grid input:checked + span::after {
  transform: translateX(20px);
}

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

.agent-doc-grid button {
  display: grid;
  place-items: center;
  min-height: 126px;
  border: 2px dashed #cfd8e3;
  border-radius: 10px;
  color: #64748b;
  background: #fff;
  text-align: center;
}

.agent-doc-grid svg {
  width: 29px;
  height: 29px;
  color: #9aa8bb;
}

.agent-doc-grid b {
  margin-top: 9px;
  color: #334155;
  font-size: 12px;
}

.agent-doc-grid small {
  margin-top: 4px;
  color: #94a3b8;
  font-size: 10px;
}

.agent-check-list {
  display: grid;
  gap: 12px;
}

.agent-check-list label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #374151;
  font-size: 12px;
}

.agent-check-list input {
  width: 13px;
  height: 13px;
  accent-color: #0754d6;
}

.agent-drawer-footer {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  padding: 22px 28px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.04);
}

.agent-drawer-cancel,
.agent-drawer-submit {
  min-width: 112px;
  height: 43px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

.agent-drawer-cancel {
  color: #111827;
  border: 1px solid #d8dee8;
  background: #fff;
}

.agent-drawer-submit {
  min-width: 162px;
  color: #fff;
  background: #0754d6;
  box-shadow: 0 12px 22px rgba(7, 84, 214, 0.24);
}

@media (max-width: 760px) {
  .agent-drawer-panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-width: none;
    height: min(92vh, 820px);
    border-radius: 18px 18px 0 0;
    overflow: hidden;
    transform: translateY(100%);
  }

  body.agent-drawer-open .agent-drawer-panel {
    transform: translateY(0);
  }

  .agent-drawer-header {
    min-height: 92px;
    padding: 24px 20px 28px;
  }

  .agent-drawer-body {
    padding: 66px 20px 22px;
  }

  .agent-avatar-upload {
    top: 66px;
  }

  .agent-avatar-camera {
    width: 76px;
    height: 76px;
  }

  .agent-form-grid.two,
  .agent-form-grid.three,
  .agent-permission-grid,
  .agent-doc-grid {
    grid-template-columns: 1fr;
  }

  .agent-drawer-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    padding: 16px 20px;
    overflow: hidden;
  }

  .agent-drawer-cancel,
  .agent-drawer-submit {
    width: calc((100vw - 52px) / 2);
    max-width: calc((100vw - 52px) / 2);
    min-width: 0;
  }
}

.sub-agent-page-table tbody tr.open-agent-profile-row {
  cursor: pointer;
}

.sub-agent-page-table tbody tr.open-agent-profile-row:hover td {
  background: #f8fbff;
}

.agent-profile-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  width: min(430px, 100vw);
  height: 100vh;
  color: #111827;
  background: #fff;
  box-shadow: -20px 0 45px rgba(15, 23, 42, 0.18);
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

body.agent-profile-open .agent-profile-panel {
  transform: translateX(0);
}

.agent-action-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  width: min(430px, 100vw);
  height: 100vh;
  color: #111827;
  background: #fff;
  box-shadow: -20px 0 45px rgba(15, 23, 42, 0.18);
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

body.agent-edit-open .agent-edit-panel,
body.agent-reset-open .agent-reset-panel,
body.agent-suspend-open .agent-suspend-panel {
  transform: translateX(0);
}

.agent-action-close {
  position: absolute;
  top: 20px;
  right: 19px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fff;
  background: transparent;
}

.agent-action-close svg {
  width: 15px;
  height: 15px;
}

.agent-edit-hero {
  position: relative;
  flex-shrink: 0;
  min-height: 90px;
  padding: 30px 20px 13px;
  color: #fff;
  background: #0754d6;
}

.agent-edit-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.agent-edit-avatar {
  position: relative;
  width: 62px;
  height: 62px;
  border: 3px solid #fff;
  border-radius: 50%;
  flex: 0 0 auto;
  background: #e5e7eb;
}

.agent-edit-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.agent-edit-avatar span {
  position: absolute;
  right: 0px;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: #0754d6;
}

.agent-edit-avatar svg {
  width: 10px;
  height: 10px;
}

.agent-edit-head h2 {
  margin: 0 30px 4px 0;
  font-size: 20px;
  line-height: 1.05;
  font-weight: 600;
}

.agent-edit-head p,
.agent-edit-head small {
  display: block;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  line-height: 1.45;
}

.agent-edit-head small {
  font-size: 12px;
}

.agent-reset-hero {
  position: relative;
  flex-shrink: 0;
  min-height: 108px;
  padding: 30px 20px 22px;
  color: #fff;
  background: #0754d6;
}

.agent-reset-hero .agent-action-close {
  top: 16px;
  right: 18px;
}

.agent-reset-hero h2,
.agent-suspend-hero h2 {
  margin: 0 42px 7px 0;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 600;
}

.agent-reset-hero p,
.agent-suspend-hero p {
  margin: 0;
  max-width: 330px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
}

.agent-suspend-hero {
  position: relative;
  display: flex;
  gap: 13px;
  flex-shrink: 0;
  min-height: 120px;
  padding: 28px 24px 24px;
  color: #991b1b;
  background: #fee2e2;
}

.agent-suspend-hero > svg {
  width: 17px;
  height: 17px;
  margin-top: 36px;
  flex: 0 0 auto;
  color: #dc2626;
}

.agent-suspend-hero h2 {
  color: #991b1b;
  font-size: 18px;
}

.agent-suspend-hero p {
  color: #991b1b;
}

.agent-action-close.danger {
  top: 15px;
  right: 17px;
  color: #991b1b;
}

.agent-action-close.danger svg {
  width: 14px;
  height: 14px;
}

.agent-action-body {
  flex: 1;
  min-height: 0;
  padding: 28px 40px 22px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(138, 154, 182, 0.65) transparent;
}

.agent-edit-panel .agent-action-body {
  padding: 17px 20px 22px;
}

.agent-reset-panel .agent-action-body,
.agent-suspend-panel .agent-action-body {
  padding: 17px 20px 20px;
}

.agent-action-body::-webkit-scrollbar {
  width: 7px;
}

.agent-action-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(138, 154, 182, 0.65);
}

.agent-edit-form,
.agent-reset-form,
.agent-suspend-form {
  display: grid;
  gap: 23px;
}

.agent-edit-section {
  display: grid;
  gap: 13px;
}

.agent-edit-section + .agent-edit-section {
  margin-top: 0;
}

.agent-edit-section h3 {
  margin: 0;
  padding-bottom: 13px;
  border-bottom: 1px solid #d8dee8;
  color: #1f2937;
  font-size: 16px;
  line-height: 1.1;
  font-weight: 600;
}

.agent-edit-permissions {
  display: grid;
  gap: 12px;
}

.agent-edit-permissions label {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 12px;
  padding: 0;
  border-radius: 0;
  color: #111827;
  background: transparent;
  font-size: 10px;
  font-weight: 600;
}

.agent-edit-permissions input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.agent-edit-permissions span {
  position: relative;
  flex: 0 0 auto;
  width: 30px;
  height: 16px;
  border-radius: 999px;
  background: #cbd5e1;
}

.agent-edit-permissions span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}

.agent-edit-permissions input:checked + span {
  background: #0754d6;
}

.agent-edit-permissions input:checked + span::after {
  transform: translateX(14px);
}

.agent-edit-docs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.agent-edit-docs button {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 88px;
  border: 1px dashed #cfd8e3;
  border-radius: 8px;
  color: #64748b;
  background: #fff;
  text-align: center;
}

.agent-edit-docs svg {
  width: 24px;
  height: 24px;
  color: #94a3b8;
}

.agent-edit-docs b {
  margin-top: 9px;
  color: #334155;
  font-size: 10px;
}

.agent-edit-docs small {
  margin-top: 4px;
  color: #64748b;
  font-size: 8px;
  font-weight: 500;
}

.agent-edit-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.agent-edit-form label,
.agent-reset-form label,
.agent-suspend-form label {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 500;
}

.agent-edit-form input,
.agent-edit-form select,
.agent-reset-form input,
.agent-suspend-form input,
.agent-suspend-form select,
.agent-suspend-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  outline: none;
  padding: 12px;
  color: #111827;
  background: #fff;
  font-size: 12px;
}

.agent-reset-form input,
.agent-suspend-form input,
.agent-suspend-form select {
  height: 49px;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
}

.agent-reset-form label,
.agent-suspend-form label {
  gap: 9px;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
}

.agent-suspend-form textarea {
  height: 66px;
  padding: 13px 14px;
  resize: none;
  font-size: 14px;
}

.agent-edit-form select,
.agent-suspend-form select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, #6b7280 50%) calc(100% - 22px) 50% /
      7px 7px no-repeat,
    linear-gradient(135deg, #6b7280 50%, transparent 50%) calc(100% - 16px)
      50% / 7px 7px no-repeat,
    #fff;
}

.agent-edit-form label > svg,
.agent-reset-form label > svg,
.agent-suspend-form label > svg {
  position: absolute;
  right: 13px;
  bottom: 9px;
  width: 13px;
  height: 13px;
  color: #6b7280;
}

.agent-reset-form label > svg,
.agent-suspend-form label > svg {
  right: 13px;
  bottom: 20px;
  width: 16px;
  height: 16px;
}

.agent-action-agent-card,
.agent-suspend-agent-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 78px;
  margin-bottom: 17px;
  padding: 14px 15px;
  border: 2px solid #fca5a5;
  border-radius: 8px;
  background: #fff;
}

.agent-suspend-agent-card {
  min-height: 80px;
  border-color: #f87171;
  border-radius: 7px;
}

.agent-action-agent-card img,
.agent-suspend-agent-card img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.agent-suspend-agent-card img {
  width: 44px;
  height: 44px;
  border: 2px solid #ef4444;
}

.agent-action-agent-card div,
.agent-suspend-agent-card div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.agent-action-agent-card strong,
.agent-suspend-agent-card strong {
  color: #111827;
  font-size: 16px;
  line-height: 1.1;
  font-weight: 600;
}

.agent-action-agent-card span,
.agent-suspend-agent-card span,
.agent-action-agent-card small,
.agent-suspend-agent-card small {
  color: #64748b;
  font-size: 12px;
  line-height: 1.1;
}

.agent-action-agent-card small {
  color: #0754d6;
}

.agent-action-checks {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.agent-action-checks label,
.agent-reactivate-check {
  display: flex !important;
  align-items: center;
  gap: 7px;
  color: #374151;
  font-size: 14px;
  line-height: 1.25;
}

.agent-action-checks input,
.agent-reactivate-check input {
  width: 12px;
  height: 12px;
  accent-color: #0754d6;
}

.agent-generate-password {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #374151;
  background: #f3f4f6;
  font-size: 12px;
  font-weight: 600;
  padding: 12px;
}

.agent-generate-password svg {
  width: 14px;
  height: 14px;
}

.agent-reset-note {
  margin-top: 16px;
  padding: 13px 14px;
  border-left: 3px solid #0754d6;
  border-radius: 6px;
  color: #0754d6;
  background: #eff6ff;
  font-size: 14px;
  line-height: 1.55;
}

.agent-suspend-warning {
  display: grid;
  gap: 10px;
  padding: 13px 16px;
  border-left: 3px solid #ef4444;
  border-radius: 6px;
  color: #991b1b;
  background: #fef2f2;
  font-size: 14px;
}

.agent-suspend-warning strong {
  font-size: 14px;
}

.agent-suspend-warning span::before {
  content: "x";
  margin-right: 12px;
  color: #991b1b;
  font-weight: 800;
}

.agent-action-footer {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  padding: 17px 40px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.04);
}

.agent-edit-panel .agent-action-footer {
  justify-content: flex-end;
  gap: 10px;
  padding: 13px 20px;
}

.agent-reset-panel .agent-action-footer,
.agent-suspend-panel .agent-action-footer {
  padding: 17px 20px;
}

.agent-action-cancel,
.agent-action-submit {
  min-width: 118px;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}

.agent-edit-panel .agent-action-submit {
  min-width: 102px;
}

.agent-action-cancel {
  color: #374151;
  border: 1px solid #d8dee8;
  background: #fff;
}

.agent-action-submit {
  color: #fff;
  background: #0754d6;
  box-shadow: 0 9px 18px rgba(7, 84, 214, 0.24);
}

.agent-action-submit.danger {
  background: #dc2626;
  box-shadow: 0 9px 18px rgba(220, 38, 38, 0.26);
}

.agent-profile-hero {
  position: relative;
  flex-shrink: 0;
  min-height: 151px;
  padding: 29px 24px 18px;
  color: #fff;
  background:
    radial-gradient(
      circle at 100% 0,
      rgba(255, 255, 255, 0.14) 0 78px,
      transparent 79px
    ),
    #0754d6;
}

.agent-profile-close {
  position: absolute;
  top: 22px;
  right: 20px;
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  color: #0f172a;
  background: #fff;
}

.agent-profile-close svg {
  width: 18px;
  height: 18px;
}

.agent-profile-top {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
}

.agent-profile-avatar {
  display: grid;
  place-items: center;
  width: 67px;
  height: 67px;
  border: 3px solid #fff;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  background: #e5e7eb;
}

.agent-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agent-profile-top h2 {
  margin: 0 42px 6px 0;
  font-size: 21px;
  line-height: 1.1;
  font-weight: 600;
}

.agent-profile-top p,
.agent-profile-top small {
  display: block;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  line-height: 1.45;
}

.agent-profile-verified,
.agent-profile-title-row > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 25px;
  padding: 0 11px;
  border-radius: 8px;
  color: #059669;
  background: #d1fae5;
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
}

.agent-profile-verified {
  margin-top: 17px;
}

.agent-profile-verified svg,
.agent-profile-title-row svg,
.agent-profile-docs span svg {
  width: 11px;
  height: 11px;
}

.agent-profile-body {
  flex: 1;
  min-height: 0;
  padding: 29px 20px 18px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(138, 154, 182, 0.65) transparent;
}

.agent-profile-body::-webkit-scrollbar {
  width: 7px;
}

.agent-profile-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(138, 154, 182, 0.65);
}

.agent-profile-section + .agent-profile-section {
  margin-top: 22px;
}

.agent-profile-section h3 {
  margin: 0 0 15px;
  color: #111827;
  font-size: 16px;
  line-height: 1.1;
  font-weight: 600;
}

.agent-profile-info-grid,
.agent-profile-finance-grid,
.agent-profile-docs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.agent-profile-info-grid div {
  min-height: 57px;
  padding: 14px 12px;
  border-radius: 8px;
  background: #f4f6fa;
}

.agent-profile-info-grid span,
.agent-profile-finance-grid span {
  display: block;
  margin-bottom: 8px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.2;
}

.agent-profile-info-grid b {
  display: block;
  color: #111827;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.agent-profile-finance-grid div {
  min-height: 119px;
  padding: 24px 18px 17px;
  border: 1px solid #e5e7eb;
  border-radius: 11px;
  background: #fff;
}

.agent-profile-finance-grid svg,
.agent-profile-finance-grid svg {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 19px;
  padding: 6px;
  border-radius: 50%;
  color: #10b981;
  background: #d1fae5;
}

.agent-profile-finance-grid div:nth-child(2) svg,
.agent-profile-finance-grid div:nth-child(2) svg {
  color: #8b5cf6;
  background: #ede9fe;
}

.agent-profile-finance-grid div:nth-child(3) svg,
.agent-profile-finance-grid div:nth-child(3) svg {
  color: #2563eb;
  background: #dbeafe;
}

.agent-profile-finance-grid div:nth-child(4) svg,
.agent-profile-finance-grid div:nth-child(4) svg {
  color: #f97316;
  background: #ffedd5;
}

.agent-profile-finance-grid strong {
  color: #111827;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
}

.agent-profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.agent-profile-stats div {
  display: grid;
  place-items: center;
  min-height: 86px;
  padding: 9px 7px;
  border-radius: 9px;
  background: #f8fafc;
  text-align: center;
}

.agent-profile-stats strong {
  color: #111827;
  font-size: 21px;
  line-height: 1;
  font-weight: 600;
}

.agent-profile-stats span {
  color: #64748b;
  font-size: 10px;
  line-height: 1.25;
}

.agent-profile-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.agent-profile-title-row h3 {
  margin: 0;
}

.agent-profile-bank {
  display: grid;
  gap: 12px;
  padding: 17px 17px 18px;
  border-radius: 10px;
  background: #f4f6fa;
}

.agent-profile-bank p {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.2;
}

.agent-profile-bank b {
  color: #111827;
  font-weight: 600;
  text-align: right;
}

.agent-profile-docs div {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  column-gap: 11px;
  align-items: center;
  min-height: 62px;
  padding: 10px 13px;
  border-radius: 9px;
  background: #f8fafc;
}

.agent-profile-docs div > svg {
  grid-row: span 2;
  width: 36px;
  height: 36px;
  padding: 9px;
  border-radius: 8px;
  color: #2563eb;
  background: #dbeafe;
}

.agent-profile-docs b {
  font-size: 12px;
  line-height: 1.2;
}

.agent-profile-docs span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #059669;
  font-size: 9px;
  font-weight: 800;
}

.agent-profile-permissions {
  display: grid;
  gap: 10px;
}

.agent-profile-permissions label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 45px;
  padding: 0 13px 0 15px;
  border-radius: 9px;
  color: #111827;
  background: #f4f6fa;
  font-size: 12px;
  font-weight: 700;
}

.agent-profile-permissions input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.agent-profile-permissions span {
  position: relative;
  flex: 0 0 auto;
  width: 41px;
  height: 22px;
  border-radius: 999px;
  background: #cbd5e1;
}

.agent-profile-permissions span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}

.agent-profile-permissions input:checked + span {
  background: #0754d6;
}

.agent-profile-permissions input:checked + span::after {
  transform: translateX(19px);
}

.agent-profile-activity {
  display: grid;
}

.agent-profile-activity div {
  display: flex;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid #eef2f7;
}

.agent-profile-activity div > svg {
  width: 30px;
  height: 30px;
  padding: 7px;
  border-radius: 50%;
  color: #2563eb;
  background: #dbeafe;
  flex: 0 0 auto;
}

.agent-profile-activity div:nth-child(2) > svg {
  color: #10b981;
  background: #d1fae5;
}

.agent-profile-activity div:nth-child(3) > svg {
  color: #f97316;
  background: #ffedd5;
}

.agent-profile-activity div:nth-child(4) > svg {
  color: #8b5cf6;
  background: #ede9fe;
}

.agent-profile-activity p {
  display: grid;
  gap: 4px;
  margin: 0;
}

.agent-profile-activity b {
  font-size: 13px;
  line-height: 1.2;
}

.agent-profile-activity span,
.agent-profile-activity small {
  color: #64748b;
  font-size: 10px;
  line-height: 1.2;
}

.agent-profile-footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 10px 10px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.04);
}

.agent-profile-footer button {
  min-width: 0;
  height: 35px;
  border-radius: 7px;
  border: 1px solid #d8dee8;
  color: #111827;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
}

.agent-profile-footer button:nth-child(2) {
  color: #fff;
  border-color: #10b981;
  background: #10b981;
}

.agent-profile-footer button:nth-child(3) {
  color: #fff;
  border-color: #8b5cf6;
  background: #8b5cf6;
}

.agent-profile-footer button:nth-child(4) {
  grid-column: span 1;
  color: #fff;
  border-color: #f97316;
  background: #f97316;
}

.agent-profile-footer button:nth-child(5) {
  grid-column: span 2;
  color: #fff;
  border-color: #ef4444;
  background: #ef4444;
}

@media (max-width: 760px) {
  .agent-profile-panel {
    width: 100vw;
  }

  .agent-action-panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-width: none;
    height: min(92vh, 820px);
    border-radius: 18px 18px 0 0;
    overflow: hidden;
    transform: translateY(100%);
  }

  .agent-edit-panel {
    width: auto;
  }

  body.agent-edit-open .agent-edit-panel,
  body.agent-reset-open .agent-reset-panel,
  body.agent-suspend-open .agent-suspend-panel {
    transform: translateY(0);
  }

  .agent-profile-hero {
    min-height: 119px;
    padding: 24px 24px 10px;
  }

  .agent-edit-hero {
    min-height: 83px;
    padding: 20px 20px 13px;
  }

  .agent-edit-avatar {
    width: 51px;
    height: 51px;
  }

  .agent-edit-head h2 {
    font-size: 18px;
  }

  .agent-edit-head p {
    font-size: 9px;
  }

  .agent-action-close {
    right: 19px;
  }

  .agent-action-body {
    padding: 28px 32px 20px;
  }

  .agent-edit-panel .agent-action-body {
    padding: 17px 20px 22px;
  }

  .agent-reset-panel .agent-action-body,
  .agent-suspend-panel .agent-action-body {
    padding: 17px 20px 20px;
  }

  .agent-edit-form input,
  .agent-edit-form select {
    height: 31px;
  }

  .agent-action-footer {
    padding: 16px 32px;
  }

  .agent-edit-panel .agent-action-footer {
    padding: 13px 20px;
  }

  .agent-reset-panel .agent-action-footer,
  .agent-suspend-panel .agent-action-footer {
    padding: 17px 20px;
  }

  .agent-profile-avatar {
    width: 57px;
    height: 57px;
  }

  .agent-profile-top h2 {
    font-size: 18px;
  }

  .agent-profile-body {
    padding: 29px 9px 12px;
  }

  .agent-profile-section h3 {
    font-size: 16px;
  }

  .agent-profile-info-grid,
  .agent-profile-finance-grid,
  .agent-profile-docs {
    gap: 10px;
  }

  .agent-profile-finance-grid div {
    min-height: 93px;
    padding: 18px 14px 14px;
  }

  .agent-profile-finance-grid i {
    margin-bottom: 13px;
  }

  .agent-profile-finance-grid strong {
    font-size: 18px;
  }

  .agent-profile-stats {
    gap: 9px;
  }

  .agent-profile-stats div {
    min-height: 68px;
  }

  .agent-profile-footer {
    padding: 14px 8px 8px;
  }
}

/* ==========================================
   AGENT SPECIFIC BOOKING TABLE
========================================== */

.agent-booking-view-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid #edf1f7;
  box-shadow: 0 14px 26px rgba(39, 66, 120, 0.08);
  margin-top: 32px;
}

.agent-booking-view-header {
  padding: 18px 24px;
  background: #fff;
}

.agent-booking-view-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.agent-booking-view-scroll {
  overflow-x: auto;
  width: 100%;
}

.agent-booking-view-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

.agent-booking-view-table thead {
  background: #f3f4f6;
}

.agent-booking-view-table th {
  padding: 18px 24px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
}

.agent-booking-view-table td {
  padding: 16px 24px;
  border-top: 1px solid #edf1f7;
  font-size: 14px;
  color: #111827;
}

.agent-booking-view-table td a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.agent-booking-view-table .amount {
  font-weight: 700;
}

.agent-booking-view-service {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.agent-booking-view-service svg {
  width: 13px;
  height: 13px;
}

.agent-booking-view-service.flight {
  color: #2563eb;
  background: #dbeafe;
}

.agent-booking-view-service.hotel {
  color: #047857;
  background: #d1fae5;
}

.agent-booking-view-service.visa {
  color: #c2410c;
  background: #fed7aa;
}

.agent-booking-view-service.insurance {
  color: #7c3aed;
  background: #ede9fe;
}

.agent-booking-view-service.holiday {
  color: #db2777;
  background: #fbcfe8;
}

.agent-booking-view-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.agent-booking-view-badge.paid {
  background: #dcfce7;
  color: #15803d;
}

.agent-booking-view-badge.partial {
  background: #fde68a;
  color: #b45309;
}

.agent-booking-view-badge.failed {
  background: #fee2e2;
  color: #dc2626;
}

.agent-booking-view-badge.refunded {
  background: #e5e7eb;
  color: #4b5563;
}

.agent-booking-view-badge.confirmed {
  background: #dcfce7;
  color: #15803d;
}

.agent-booking-view-badge.pending {
  background: #fde68a;
  color: #b45309;
}

.agent-booking-view-badge.completed {
  background: #dbeafe;
  color: #2563eb;
}

.agent-booking-view-badge.cancelled {
  background: #fee2e2;
  color: #dc2626;
}

.agent-booking-view-action {
  text-align: center;
}

.agent-booking-view-action svg {
  width: 18px;
  height: 18px;
  color: #6b7280;
}

@media (max-width: 768px) {
  .agent-booking-view-scroll {
    overflow-x: auto;
  }

  .agent-booking-view-table {
    min-width: 1200px;
  }
}
