@import url("https://cdn.jsdelivr.net/gh/rastikerdar/shabnam-font@v5.0.1/dist/font-face.css");

:root {
  --blue-900: #082f66;
  --blue-800: #0b4f9f;
  --blue-700: #1565d8;
  --blue-600: #1d6fe3;
  --blue-500: #2e8cff;
  --blue-100: #dcecff;
  --blue-050: #f2f8ff;
  --white: #ffffff;
  --slate-900: #102033;
  --slate-700: #33465f;
  --slate-500: #66758a;
  --slate-200: #d9e4f2;
  --slate-100: #edf3fb;
  --danger: #dc2626;
  --danger-050: #fff1f2;
  --danger-100: #ffe4e6;
  --success: #0f9f6e;
  --warning: #f59e0b;
  --shadow: 0 18px 42px rgba(12, 71, 145, .10);
  --radius-xl: 22px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 24px;
  min-height: 100vh;
  font-family: Shabnam, Tahoma, Arial, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(46, 140, 255, .16), transparent 28rem),
    linear-gradient(135deg, var(--blue-050), #ffffff 44%, #eef6ff);
  color: var(--slate-900);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
svg { width: 1.25rem; height: 1.25rem; fill: currentColor; display: block; }

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  width: min(1220px, 100%);
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  padding: 18px;
  border: 1px solid rgba(29, 111, 227, .14);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  color: var(--white);
  background: linear-gradient(135deg, var(--blue-700), var(--blue-500));
  box-shadow: 0 12px 24px rgba(29, 111, 227, .24);
}
.brand strong { display: block; color: var(--blue-900); font-size: 16px; }
.brand span { display: block; color: var(--slate-500); font-size: 11px; margin-top: 3px; }

.nav-list { display: grid; gap: 8px; flex: 1; align-content: start; }
.nav-item {
  width: 100%;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 14px;
  text-align: right;
  color: var(--slate-700);
  background: transparent;
  transition: .2s ease;
}
.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  color: var(--blue-700);
  background: var(--blue-050);
}
.nav-icon svg { width: 19px; height: 19px; }
.nav-item b { display: block; font-weight: 900; }
.nav-item small { display: block; margin-top: 3px; color: var(--slate-500); font-size: 11px; }
.nav-item:hover { background: var(--blue-050); border-color: var(--blue-100); }
.nav-item.active {
  color: var(--white);
  background: linear-gradient(135deg, var(--blue-700), var(--blue-500));
  box-shadow: 0 14px 26px rgba(29, 111, 227, .22);
}
.nav-item.active small { color: rgba(255,255,255,.82); }
.nav-item.active .nav-icon { color: var(--blue-800); background: #fff; }
.menu-delete-button {
  width: 100%;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 11px;
  border: 1px solid rgba(220, 38, 38, .22);
  border-radius: 14px;
  color: #fff;
  background: var(--danger);
  text-align: right;
  box-shadow: 0 12px 22px rgba(220, 38, 38, .18);
}
.menu-delete-button .nav-icon { color: var(--danger); background: #fff; }

.content { min-width: 0; padding-bottom: 8px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 0 0 10px;
  min-height: 42px;
}
.topbar-minimal { justify-content: flex-start; }
.eyebrow { margin: 0 0 3px; color: var(--blue-700); font-size: 12px; font-weight: 800; }
h1 { margin: 0; font-size: clamp(23px, 2.4vw, 34px); color: var(--blue-900); }
.mobile-menu {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  color: var(--blue-800);
  background: rgba(255,255,255,.8);
  border: 1px solid var(--blue-100);
  border-radius: 14px;
}

button,
.primary-btn,
.secondary-btn,
.danger-btn,
.link-btn {
  border: 0;
  border-radius: 13px;
  padding: 10px 14px;
  font-weight: 800;
}
.primary-btn { color: var(--white); background: linear-gradient(135deg, var(--blue-700), var(--blue-500)); box-shadow: 0 10px 20px rgba(29, 111, 227, .18); }
.secondary-btn { color: var(--blue-800); background: var(--blue-100); }
.danger-btn { color: #fff; background: var(--danger); }
.link-btn { padding: 0; color: var(--blue-700); background: transparent; }
.danger-text { color: var(--danger); }

.hero-card,
.card,
.metric-card {
  border: 1px solid rgba(29, 111, 227, .14);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
}

.hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  margin-bottom: 16px;
}
.profile-summary { display: flex; align-items: center; gap: 14px; min-width: 0; }
.avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 24px;
  color: #fff;
  font-size: 30px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--blue-900), var(--blue-500));
  box-shadow: 0 16px 30px rgba(29, 111, 227, .20);
}
.hero-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.hero-title-row h2 { margin: 0; font-size: 24px; color: var(--blue-900); }
.profile-summary p { margin: 6px 0 10px; color: var(--slate-500); }
.badge,
.soft-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}
.verified { color: var(--success); background: #e6fff6; }
.premium { color: var(--blue-800); background: var(--blue-100); }
.soft-pill { color: var(--blue-800); background: var(--blue-100); }
.progress-wrap { width: min(400px, 100%); }
.progress-label { display: flex; justify-content: space-between; color: var(--slate-700); font-size: 12px; margin-bottom: 6px; }
.progress { height: 8px; background: var(--slate-100); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue-700), var(--blue-500)); }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.hero-stats div { min-width: 92px; padding: 12px; border-radius: 16px; background: var(--blue-050); text-align: center; }
.hero-stats strong { display: block; color: var(--blue-800); font-size: 21px; }
.hero-stats span { color: var(--slate-500); font-size: 11px; }

.tab-panel { display: none; animation: fadeIn .25s ease; }
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.grid { display: grid; gap: 14px; margin-bottom: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card,
.metric-card { padding: 18px; }
.metric-card h3,
.card h3 { margin: 0 0 6px; color: var(--blue-900); }
.metric-card p,
.card p { color: var(--slate-500); line-height: 1.75; margin: 0 0 12px; }
.metric-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 10px;
  border-radius: 14px;
  color: var(--blue-700);
  background: var(--blue-100);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid.one { grid-template-columns: 1fr; }
.compact-form { gap: 10px 12px; }
label { color: var(--slate-700); font-weight: 800; }
input, select, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid var(--slate-200);
  border-radius: 13px;
  outline: 0;
  color: var(--slate-900);
  background: #fbfdff;
  transition: .2s ease;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(46, 140, 255, .12); }
.wide { grid-column: 1 / -1; }
.hint { font-size: 12px; }

.switch { display: inline-flex; align-items: center; margin: 0; }
.switch input { display: none; }
.switch span {
  position: relative;
  width: 48px;
  height: 27px;
  border-radius: 999px;
  background: #cdd9e8;
  transition: .2s ease;
}
.switch span::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,.16);
  transition: .2s ease;
}
.switch input:checked + span { background: var(--blue-600); }
.switch input:checked + span::after { right: 25px; }
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--slate-100);
}
.setting-row:last-child { border-bottom: 0; }
.setting-row p { margin: 4px 0 0; }
.status { display: inline-flex; padding: 6px 9px; border-radius: 999px; font-size: 11px; }
.status.on { color: var(--success); background: #e6fff6; }
.status.muted { color: var(--slate-500); background: var(--slate-100); }
.status.warning { color: var(--warning); background: #fff7e6; }

.password-strength { height: 8px; margin: 14px 0 8px; background: var(--slate-100); border-radius: 999px; overflow: hidden; }
.password-strength span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--danger); transition: .2s ease; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { padding: 12px; text-align: right; border-bottom: 1px solid var(--slate-100); }
th { color: var(--blue-900); font-size: 13px; background: var(--blue-050); }
td { color: var(--slate-700); }

.plan-card h3 { font-size: 30px; margin-top: 12px; }
.price { margin: 16px 0; color: var(--blue-900); font-size: 24px; font-weight: 900; }
.price span { color: var(--slate-500); font-size: 13px; font-weight: 700; }
.plan-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.payment-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--blue-100);
  border-radius: 16px;
  background: var(--blue-050);
}
.payment-card span { display: block; margin-top: 4px; color: var(--slate-500); font-size: 12px; }
.integration-card { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.danger-zone { border-color: rgba(220, 38, 38, .18); }
.toast {
  position: fixed;
  left: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 13px 16px;
  color: var(--white);
  background: var(--blue-800);
  border-radius: 16px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: .25s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

.address-card p { margin-bottom: 10px; }
.wallet-balance h3 { margin-top: 12px; font-size: clamp(28px, 4vw, 42px); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 47, 102, .36);
  backdrop-filter: blur(10px);
}
.modal-backdrop.show { display: flex; }
.modal-card {
  width: min(480px, 100%);
  padding: 24px;
  border: 1px solid rgba(220, 38, 38, .18);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: 0 24px 70px rgba(8, 47, 102, .22);
  animation: modalIn .22s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  color: var(--danger);
  background: var(--danger-100);
}
.modal-icon svg { width: 26px; height: 26px; }
.modal-card h3 { margin: 14px 0 8px; color: var(--danger); }
.modal-card p { margin: 0 0 14px; color: var(--slate-500); line-height: 1.8; }
.confirm-label { display: block; margin-top: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.danger-btn:disabled { opacity: .48; cursor: not-allowed; }

body.account-deleted .hero-card,
body.account-deleted .tab-panel:not(#overview) { opacity: .45; pointer-events: none; }

@media (max-width: 1040px) {
  body { padding: 16px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    z-index: 20;
    top: 16px;
    right: 16px;
    bottom: 16px;
    width: min(320px, calc(100vw - 32px));
    height: auto;
    transform: translateX(calc(100% + 24px));
    transition: .25s ease;
  }
  body.menu-open .sidebar { transform: translateX(0); }
  .mobile-menu { display: inline-flex; }
  .hero-card { align-items: stretch; flex-direction: column; }
}

@media (max-width: 780px) {
  .grid.two,
  .grid.three,
  .form-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr; }
  .profile-summary { align-items: flex-start; }
  .avatar { width: 60px; height: 60px; border-radius: 20px; font-size: 24px; }
  .card-head { align-items: flex-start; flex-direction: column; }
}

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--blue-100);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
}
.back-btn::before {
  content: "‹";
  font-size: 22px;
  line-height: 1;
}
.action-page .card,
.action-page .metric-card { margin-bottom: 14px; }
.no-margin { margin-bottom: 0; }
.upload-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin-bottom: 14px;
  border: 1px dashed var(--blue-100);
  border-radius: 18px;
  background: var(--blue-050);
}
.avatar.large { width: 92px; height: 92px; border-radius: 28px; font-size: 38px; }
.timeline {
  position: relative;
  display: grid;
  gap: 12px;
  padding-right: 10px;
}
.timeline > div {
  position: relative;
  padding: 12px 18px 12px 12px;
  border: 1px solid var(--slate-100);
  border-radius: 16px;
  background: #fbfdff;
}
.timeline > div::before {
  content: "";
  position: absolute;
  top: 18px;
  right: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--slate-200);
}
.timeline > div.done::before { background: var(--success); }
.timeline > div.active::before { background: var(--warning); }
.timeline b,
.product-row b,
.total-row b { color: var(--blue-900); }
.timeline span,
.detail-list span { display: block; margin-top: 4px; color: var(--slate-500); font-size: 12px; }
.product-row,
.total-row,
.detail-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--slate-100);
}
.total-row {
  margin-top: 8px;
  border-bottom: 0;
  font-size: 16px;
}
.invoice-card { overflow: hidden; }
.invoice-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--slate-100);
}
.quick-amounts,
.codes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.quick-amounts span,
.codes-grid code {
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 1px solid var(--blue-100);
  border-radius: 14px;
  color: var(--blue-800);
  background: var(--blue-050);
  font-weight: 900;
}
.codes-grid code {
  direction: ltr;
  font-family: Consolas, Monaco, monospace;
  letter-spacing: .08em;
}
.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.plan-option { min-height: 170px; }
.plan-option.selected {
  border-color: rgba(29, 111, 227, .42);
  box-shadow: 0 18px 42px rgba(29, 111, 227, .16);
}
.detail-list {
  display: grid;
  gap: 0;
}
.inline-action-form input[type="file"] {
  direction: ltr;
}

@media (max-width: 780px) {
  .page-toolbar,
  .invoice-head { align-items: flex-start; flex-direction: column; }
  .quick-amounts,
  .codes-grid { grid-template-columns: 1fr; }
  .upload-box { align-items: flex-start; flex-direction: column; }
}
