@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Vazirmatn:wght@400;500;600;700;800&display=swap");

* {
  box-sizing: border-box;
}

html {
  direction: rtl;
}

body {
  position: relative;
  min-height: 100vh;
  font-family: "Outfit", "Vazirmatn", Tahoma, Arial, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top right, rgba(70, 95, 255, 0.08), transparent 24%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  color: #1e293b;
}

body.brand-theme-active {
  --brand-bg-shift-x: 0px;
  --brand-bg-size: min(76vw, 920px);
  --brand-bg-glow-size: min(64vw, 760px);
  background:
    radial-gradient(circle at top right, rgba(70, 95, 255, 0.12), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, #edf4ff 100%);
}

body.brand-theme-active::before,
body.brand-theme-active::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

body.brand-theme-active::before {
  top: 50%;
  left: calc(50% - var(--brand-bg-shift-x));
  width: var(--brand-bg-size);
  aspect-ratio: 1;
  border-radius: 50%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0.14;
  transform: translate(-50%, -40%);
  filter: saturate(1.08) contrast(1.04);
}

body.brand-theme-active::after {
  left: calc(50% - var(--brand-bg-shift-x));
  bottom: 10%;
  width: var(--brand-bg-glow-size);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.14) 0%, rgba(59, 130, 246, 0.08) 36%, transparent 70%);
  transform: translateX(-50%);
  filter: blur(22px);
  opacity: 0.75;
}

body.brand-theme-sibkadeh::before {
  background-image: url("/static/branding/sibkadeh.png");
}

main {
  position: relative;
  z-index: 1;
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.bg-brand-600 {
  background-color: #465fff;
}

.text-brand-600 {
  color: #465fff;
}

.hover\:bg-brand-600:hover {
  background-color: #465fff;
}

.hover\:bg-brand-700:hover {
  background-color: #3641f5;
}

.hover\:border-brand-600:hover,
.focus\:border-brand-600:focus {
  border-color: #465fff;
}

.focus\:ring-brand-100:focus {
  --tw-ring-color: rgba(70, 95, 255, 0.16);
}

.shadow-soft {
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

.menu-button {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.menu-button:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(148, 163, 184, 0.2);
  color: #f8fafc;
}

.menu-button-active {
  background-color: #465fff;
  border-color: #465fff;
  color: #fff;
  box-shadow: 0 10px 25px rgba(70, 95, 255, 0.28);
}

.menu-button-active:hover {
  background-color: #3641f5;
  border-color: #3641f5;
}

.dashboard-sidebar {
  background:
    linear-gradient(180deg, #111827 0%, #182235 100%);
  border-color: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
}

.dashboard-sidebar-copy {
  color: #94a3b8;
}

.sidebar-panel-title {
  text-align: center;
  margin-inline: auto;
  width: 100%;
}

.login-page-title {
  text-align: center;
  margin-inline: auto;
  width: 100%;
}

.sidebar-info-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background-color: rgba(255, 255, 255, 0.04);
  padding: 14px 16px;
}

.sidebar-info-label {
  color: #94a3b8;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.sidebar-stats-table {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.03);
}

.sidebar-stats-cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: center;
}

.sidebar-stats-user {
  grid-column: 2;
  grid-row: 1 / span 2;
  border-left: 1px solid rgba(148, 163, 184, 0.18);
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 14px 14px 12px;
  position: relative;
  overflow: hidden;
}

.sidebar-stats-sold {
  grid-column: 1;
  grid-row: 1;
}

.sidebar-stats-remaining {
  grid-column: 1;
  grid-row: 2;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.sidebar-stats-label {
  color: #94a3b8;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.8;
  padding: 10px 10px 8px;
  text-align: center;
}

.sidebar-stats-value {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.7;
  padding: 8px 10px 10px;
  text-align: center;
  white-space: nowrap;
}

.sidebar-stats-username {
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  width: 100%;
}

.sidebar-brand-logo {
  display: block;
  width: min(100%, 164px);
  max-height: 124px;
  object-fit: contain;
  margin-inline: auto;
  opacity: 0.76;
  mix-blend-mode: screen;
  filter: saturate(1.04) brightness(1.1) contrast(1.08) drop-shadow(0 10px 18px rgba(37, 99, 235, 0.12));
  isolation: isolate;
  transform: scale(1.06);
}

.sidebar-stats-user::after {
  content: "";
  position: absolute;
  inset: auto 14px 6px 14px;
  height: 56%;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(56, 189, 248, 0.12) 0%, rgba(59, 130, 246, 0.06) 42%, transparent 76%);
  pointer-events: none;
  opacity: 0.8;
}

.sidebar-info-line {
  color: #f8fafc;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.8;
  text-align: center;
  white-space: nowrap;
}

.sidebar-info-line-secondary {
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}

.sidebar-info-line-time {
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 700;
  margin-top: 6px;
}

.sidebar-logout {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: rgba(148, 163, 184, 0.18);
  color: #f8fafc;
}

.sidebar-logout:hover {
  background-color: rgba(70, 95, 255, 0.14);
  border-color: rgba(70, 95, 255, 0.42);
  color: #fff;
}

.dashboard-card {
  background-color: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  min-width: 0;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

.dashboard-top-row,
.dashboard-top-copy,
.dashboard-action-card,
.dashboard-card-title-row {
  min-width: 0;
  width: 100%;
}

.dashboard-top-row {
  align-items: center;
  min-height: 84px;
}

.dashboard-card-title-row {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.dashboard-top-copy {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
}

.dashboard-action-card {
  min-height: 92px;
}

#viewManage,
#viewManage > section,
#viewAgents,
#viewAgents > section {
  min-width: 0;
}

#viewReports,
#viewReports > section {
  min-width: 0;
}

.dashboard-muted {
  color: #64748b;
}

.dashboard-stat-card {
  background-color: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.dashboard-surface {
  background-color: #f8fafc;
  border-color: #e2e8f0;
}

.dashboard-dashed {
  border-color: #cbd5e1;
  background-color: rgba(255, 255, 255, 0.86);
}

.receive-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.9;
  margin: 0;
  padding: 14px 16px;
  text-align: center;
}

.receive-notice-error {
  background-color: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.18);
  color: #dc2626;
}

.sell-hint {
  color: #dc2626;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.9;
  margin-bottom: 14px;
  text-align: center;
  animation: sell-hint-blink 2s linear infinite;
}

.dashboard-section-title {
  color: #0f172a;
}

.dashboard-panel-copy {
  color: #64748b;
}

@keyframes sell-hint-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.2;
  }
}

.manage-action-button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 14px;
  font-weight: 700;
  transition: 0.2s ease;
}

.manage-action-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.manage-action-enable {
  background-color: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.24);
  color: #15803d;
}

.manage-action-enable:hover {
  background-color: rgba(34, 197, 94, 0.18);
}

.manage-action-disable {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #b91c1c;
}

.manage-action-disable:hover {
  background-color: rgba(239, 68, 68, 0.16);
}

.manage-action-password {
  background-color: rgba(70, 95, 255, 0.1);
  border-color: rgba(70, 95, 255, 0.18);
  color: #3641f5;
}

.manage-action-password:hover {
  background-color: rgba(70, 95, 255, 0.16);
}

.manage-password-input {
  direction: ltr;
}

.manage-password-editor {
  display: flex;
  align-items: stretch;
  min-height: 40px;
  min-width: 176px;
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background-color: #f8fafc;
  overflow: hidden;
}

.manage-password-editor:focus-within {
  border-color: #465fff;
  box-shadow: 0 0 0 4px rgba(70, 95, 255, 0.16);
}

.manage-password-editor .manage-password-input {
  flex: 1 1 auto;
  min-width: 96px;
  width: 100%;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.manage-password-editor .manage-password-input:focus {
  box-shadow: none !important;
}

.manage-password-editor .manage-action-password {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 40px;
  height: auto;
  align-self: stretch;
  border: none;
  border-radius: 0 !important;
  border-inline-start: 1px solid rgba(70, 95, 255, 0.18);
  padding: 0 12px;
  white-space: nowrap;
}

.manage-password-cell {
  min-width: 196px;
}

.agent-password-value {
  min-width: 140px;
}

.agents-results-wrap {
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.agents-results-table {
  min-width: max-content;
  width: 100%;
}

.agent-report-cell {
  min-width: 210px;
}

.agent-report-editor {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  min-height: 40px;
  min-width: 192px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background-color: #fff;
  overflow: hidden;
}

.agent-report-editor:focus-within {
  border-color: #465fff;
  box-shadow: 0 0 0 4px rgba(70, 95, 255, 0.16);
}

.agent-report-input {
  min-width: 0;
  width: 100%;
  border: none !important;
  border-inline-start: 1px solid rgba(148, 163, 184, 0.2);
  border-inline-end: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  text-align: center !important;
  text-align-last: center;
  direction: ltr;
  font-weight: 700 !important;
  line-height: 40px;
  font-variant-numeric: tabular-nums;
}

.agent-report-input:focus {
  box-shadow: none !important;
}

.agent-report-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  min-height: 40px;
  border: none;
  border-radius: 0 !important;
  padding: 0 8px;
  white-space: nowrap;
  box-shadow: none;
}

.agent-report-toggle.manage-action-enable {
  background-color: rgba(34, 197, 94, 0.12);
  border-inline-end: 1px solid rgba(34, 197, 94, 0.14);
  color: #15803d;
}

.agent-report-toggle.manage-action-enable:hover {
  background-color: rgba(34, 197, 94, 0.18);
}

.agent-report-toggle.manage-action-disable {
  background-color: rgba(239, 68, 68, 0.1);
  border-inline-end: 1px solid rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.agent-report-toggle.manage-action-disable:hover {
  background-color: rgba(239, 68, 68, 0.16);
}

.agent-report-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  min-height: 40px;
  border: none;
  border-radius: 0 !important;
  border-inline-start: 1px solid rgba(70, 95, 255, 0.18);
  background-color: rgba(70, 95, 255, 0.1);
  color: #3641f5;
  font-weight: 700;
  padding: 0 8px;
  white-space: nowrap;
}

.agent-report-save:hover {
  background-color: rgba(70, 95, 255, 0.16);
}

@media (max-width: 640px) {
  .agent-report-cell {
    min-width: 210px;
  }
}

.manage-page-button {
  min-height: 40px;
  min-width: 110px;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background-color: #fff;
  color: #334155;
  font-weight: 700;
  padding: 0 16px;
  transition: 0.2s ease;
}

.manage-page-button:hover {
  border-color: rgba(70, 95, 255, 0.38);
  color: #3641f5;
}

.manage-page-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.manage-page-box {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  width: 252px;
  max-width: 100%;
  min-width: 230px;
  min-height: 40px;
  overflow: hidden;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background-color: #f8fafc;
  color: #334155;
}

.manage-page-box:focus-within {
  border-color: #465fff;
  box-shadow: 0 0 0 4px rgba(70, 95, 255, 0.16);
}

.manage-page-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  width: 100%;
  gap: 8px;
  min-width: 0;
  padding: 0 12px;
}

.manage-page-segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  white-space: nowrap;
}

.manage-page-box-spacer {
  display: none;
}

.manage-page-box-label,
.manage-page-box-separator,
.manage-page-box-total {
  font-size: 14px;
  font-weight: 700;
}

.manage-page-box-label {
  color: #475569;
}

.manage-page-input-segment {
  width: 52px;
  min-width: 52px;
}

.manage-page-box-separator {
  min-width: 36px;
}

.manage-page-box-total {
  min-width: 36px;
}

.manage-page-input {
  width: 100%;
  min-width: 0;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  direction: ltr;
  color: #334155 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-align: center;
}

.manage-page-input:focus {
  box-shadow: none !important;
}

.manage-page-inline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 40px;
  border: none;
  border-radius: 0 !important;
  border-inline-start: 1px solid rgba(70, 95, 255, 0.18);
  background-color: rgba(70, 95, 255, 0.1);
  color: #3641f5;
  font-weight: 700;
  padding: 0 12px;
  transition: 0.2s ease;
  white-space: nowrap;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}

.manage-page-inline-button:hover {
  background-color: rgba(70, 95, 255, 0.16);
}

.manage-page-inline-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.manage-end-date-column {
  min-width: 164px;
}

.manage-end-date-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.manage-end-date-line {
  color: inherit;
  font: inherit;
  line-height: 1.6;
  text-align: center;
  white-space: nowrap;
}

.manage-row-expired > td {
  background-color: rgba(239, 68, 68, 0.08);
}

.manage-row-waiting > td {
  background-color: rgba(34, 197, 94, 0.08);
}

.report-results-wrap {
  max-width: 100%;
}

.report-results-table {
  min-width: max-content;
  width: 100%;
}

.report-sale-datetime-cell {
  min-width: 122px;
}

.report-sale-datetime {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.report-sale-datetime-line {
  white-space: nowrap;
  text-align: center;
}

@media (max-width: 640px) {
  body.brand-theme-active::before {
    width: min(92vw, 560px);
    opacity: 0.12;
    transform: translate(-50%, -31%);
  }

  body.brand-theme-active::after {
    width: min(88vw, 420px);
    bottom: 16%;
    opacity: 0.52;
  }

  .login-page-title {
    font-size: clamp(1rem, 4.6vw, 1.45rem);
    line-height: 1.2;
    max-width: 100%;
    white-space: nowrap;
  }

  .sidebar-info-line {
    white-space: normal;
  }

  .sidebar-stats-table {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  }

  .sidebar-stats-value {
    white-space: normal;
  }
}

@media (min-width: 1024px) {
  body.brand-theme-active {
    --brand-bg-shift-x: clamp(150px, 16vw, 230px);
    --brand-bg-size: min(64vw, 860px);
    --brand-bg-glow-size: min(54vw, 680px);
  }

  .workspace-panels {
    gap: 8px !important;
    row-gap: 8px !important;
  }

  #viewReceive {
    display: flex;
    flex-direction: column;
    justify-items: stretch;
    gap: 80px;
  }

  #activityStack {
    gap: 8px;
  }

  .sidebar-stats-label-remaining {
    font-size: 13px;
    white-space: nowrap;
  }

  .sidebar-stats-username {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-brand-logo {
    width: min(100%, 132px);
    max-height: 96px;
    opacity: 0.72;
  }

  .receive-action-card,
  .receive-notice,
  #resultPanel {
    height: 200px;
    min-height: 108px;
    max-width: none;
    width: 100%;
  }

  #resultPanel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 1fr) 180px;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
  }

  #resultPanel dl {
    margin: 0;
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 6px 10px;
    align-items: center;
  }

  #resultPanel dt,
  #resultPanel dd {
    margin: 0;
  }

  #resultPanel dd {
    font-size: 1.05rem;
    line-height: 1.35;
  }

  #resultPanel .sell-hint {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    text-align: center;
  }

  #sellButton {
    align-self: center;
  }

  .sidebar-panel-title {
    font-size: 1.1rem;
    line-height: 1.45;
    white-space: nowrap;
  }

  .login-page-title {
    font-size: 2rem;
    line-height: 1.35;
    white-space: nowrap;
  }
}
