:root {
  --bg: #030914;
  --surface: #081426;
  --surface-2: #0d2038;
  --surface-3: #102b4c;
  --text: #f3f8ff;
  --muted: #91afd4;
  --line: rgba(112, 199, 255, 0.2);
  --blue: #2f7df6;
  --cyan: #52dcff;
  --cyan-soft: rgba(82, 220, 255, 0.12);
  --danger: #ff6578;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.auth-view {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(47, 125, 246, 0.16), transparent 34%),
    linear-gradient(315deg, rgba(82, 220, 255, 0.1), transparent 30%),
    var(--bg);
}

.auth-view::before {
  content: "";
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(48vw, 560px);
  height: min(48vw, 560px);
  transform: translate(-50%, -50%);
  background: url("./assets/wf-tools-icon.png") center / contain no-repeat;
  opacity: 0.055;
  pointer-events: none;
  z-index: 0;
}

.auth-view > * {
  position: relative;
  z-index: 1;
}

.auth-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.brand-inline,
.user-chip,
.system-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-inline strong,
.brand-inline small,
.user-chip small {
  display: block;
  color: var(--muted);
}

.logo-box {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.logo-box.large {
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
}

.logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-box span {
  display: none;
  color: var(--cyan);
  font-weight: 900;
  font-size: 10px;
  line-height: 1;
  text-align: center;
}

.system-status {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(8, 20, 38, 0.86);
  color: #dcf7ff;
  font-size: 13px;
  font-weight: 800;
}

.system-status span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 18px var(--cyan);
}

.auth-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  gap: 34px;
  align-items: center;
  padding-top: 24px;
  padding-bottom: 24px;
}

.product-panel {
  max-width: 780px;
}

.eyebrow,
.form-header p,
.topbar p,
.tool-copy p,
.modal-header p {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.product-panel h1 {
  display: grid;
  gap: 6px;
  max-width: 820px;
  margin: 0;
  font-size: clamp(38px, 4.4vw, 58px);
  line-height: 1.02;
  letter-spacing: 0;
}

.product-panel h1 span {
  display: block;
}

.product-panel p {
  max-width: 720px;
  margin: 18px 0 0;
  color: #bad2ee;
  font-size: 18px;
  line-height: 1.6;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.metric-row article,
.login-card,
.summary-card,
.tool-panel,
.activity-panel,
.modal-card,
.user-chip {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 20, 38, 0.86);
  box-shadow: var(--shadow);
}

.metric-row article {
  padding: 16px;
  box-shadow: none;
}

.metric-row span,
.summary-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric-row strong,
.summary-card strong {
  display: block;
  margin-top: 7px;
  color: var(--text);
}

.developer-brand {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 28px;
  width: 100%;
  max-width: none;
  margin: 18px 0 0;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 20, 38, 0.56);
  padding: 16px 18px;
}

.developer-brand img {
  width: 130px;
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
  opacity: 0.96;
}

.developer-brand span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.developer-brand strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 16px;
  letter-spacing: 0.5px;
}

.login-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
}

.form-header {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  text-align: center;
}

.form-header .logo-box.large {
  width: 116px;
  height: 116px;
  border-radius: 24px;
  margin: 0 auto 18px;
  background: rgba(82, 220, 255, 0.08);
  box-shadow:
    0 20px 50px rgba(47, 125, 246, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.form-header h2,
.topbar h2,
.tool-copy h3,
.section-title h3,
.modal-header h3 {
  margin: 0;
  letter-spacing: 0;
}

.form-header h2 {
  font-size: 34px;
}

label {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: #e8f4ff;
  font-size: 14px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #050d1b;
  color: var(--text);
  padding: 14px;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px var(--cyan-soft);
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.remember-row input {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--cyan);
}

.primary-action,
.ghost-action,
.tool-button,
.logout-button,
.nav-item {
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 0 18px;
  font-weight: 900;
}

.primary-action,
.tool-button {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #1558dd);
}

.danger-action {
  background: linear-gradient(135deg, #ff6578, #c9233c);
}

.primary-action:hover,
.tool-button:hover {
  filter: brightness(1.08);
}

.ghost-action {
  color: #dff8ff;
  background: transparent;
  border-color: var(--line);
}

.login-card .primary-action,
.login-card .ghost-action {
  width: 100%;
  margin-top: 18px;
}

.login-card .ghost-action {
  margin-top: 10px;
}

.form-message {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.form-message.error {
  color: var(--danger);
}

.dashboard {
  position: relative;
  min-height: 100vh;
  display: block;
  background:
    linear-gradient(180deg, rgba(47, 125, 246, 0.09), transparent 260px),
    var(--bg);
  overflow: hidden;
}

.dashboard::before {
  content: "";
  position: fixed;
  left: 50%;
  top: 52%;
  width: min(54vw, 720px);
  height: min(54vw, 720px);
  transform: translate(-50%, -50%);
  background: url("./assets/wf-tools-icon.png") center / contain no-repeat;
  opacity: 0.035;
  pointer-events: none;
  z-index: 0;
}

.nav-item {
  width: auto;
  text-align: center;
  color: #b9d5f2;
  background: transparent;
}

.nav-item.active,
.nav-item:hover {
  color: #fff;
  background: var(--surface-2);
}

.logout-button {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  transform: translateX(-50%);
  color: #fff;
  background: linear-gradient(135deg, #ff6578, #c9233c);
  border-color: rgba(255, 101, 120, 0.42);
  width: min(260px, 100%);
  margin: 0;
  box-shadow: 0 18px 40px rgba(201, 35, 60, 0.22);
}

.workspace {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 100vh;
  padding: 28px 28px 104px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 20, 38, 0.68);
  padding: 8px;
}

.user-chip {
  min-width: 220px;
  padding: 10px 12px;
  box-shadow: none;
}

.user-chip > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--cyan-soft);
  color: var(--cyan);
  font-weight: 900;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.credit-alert {
  margin-top: 24px;
  border: 1px solid rgba(82, 220, 255, 0.34);
  border-radius: 14px;
  background: rgba(82, 220, 255, 0.1);
  color: #dffcff;
  padding: 14px 16px;
  font-weight: 800;
}

.summary-card {
  padding: 22px;
  box-shadow: none;
}

.summary-card strong {
  font-size: clamp(24px, 3vw, 34px);
}

.credits-card {
  background: linear-gradient(135deg, rgba(47, 125, 246, 0.28), rgba(8, 20, 38, 0.86));
}

.tool-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  padding: 24px;
  box-shadow: none;
}

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

.recharge-card,
.payment-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 20, 38, 0.86);
  padding: 22px;
}

.recharge-card {
  display: grid;
  gap: 12px;
}

.recharge-card span,
.payment-panel p,
.payment-summary span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.recharge-card strong {
  color: var(--text);
  font-size: 30px;
}

.recharge-card p {
  margin: 0;
  color: var(--cyan);
  font-size: 18px;
  font-weight: 900;
}

.featured-plan {
  background: linear-gradient(135deg, rgba(47, 125, 246, 0.26), rgba(8, 20, 38, 0.92));
}

.payment-panel {
  margin-top: 16px;
}

.payment-panel h3 {
  margin: 8px 0;
}

.payment-panel span {
  color: var(--muted);
  line-height: 1.55;
}

.qr-payment {
  display: grid;
  justify-items: center;
  gap: 18px;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #050d1b;
  padding: 22px;
  text-align: center;
}

.qr-payment img {
  width: min(100%, 280px);
  height: 280px;
  border-radius: 12px;
  object-fit: contain;
  background: #fff;
}

.qr-payment div {
  display: grid;
  gap: 6px;
}

.qr-payment strong {
  color: var(--text);
  font-size: 22px;
}

.payment-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #050d1b;
  padding: 16px;
}

.payment-summary strong {
  color: var(--text);
  font-size: 20px;
}

.tool-copy span {
  display: block;
  max-width: 680px;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.tool-button {
  min-width: 190px;
}

.activity-panel {
  margin-top: 18px;
  padding: 24px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  min-height: 360px;
  max-height: 520px;
}

.users-view {
  margin-top: 26px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-title span,
.request-item span {
  color: var(--muted);
  font-size: 14px;
}

.request-list {
  display: grid;
  gap: 10px;
  overflow-y: auto;
  padding-right: 6px;
  max-height: 410px;
  scrollbar-color: rgba(82, 220, 255, 0.45) rgba(8, 20, 38, 0.7);
  scrollbar-width: thin;
}

.request-list::-webkit-scrollbar {
  width: 8px;
}

.request-list::-webkit-scrollbar-track {
  background: rgba(8, 20, 38, 0.7);
  border-radius: 999px;
}

.request-list::-webkit-scrollbar-thumb {
  background: rgba(82, 220, 255, 0.45);
  border-radius: 999px;
}

.request-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #050d1b;
}

.request-meta {
  display: grid;
  gap: 4px;
}

.request-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pdf-input {
  max-width: 220px;
  padding: 8px;
  font-size: 12px;
}

.empty-state {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 18px;
  color: var(--muted);
}

.table-shell {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 20, 38, 0.86);
}

.users-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.users-table th,
.users-table td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.users-table th {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.users-table td {
  color: #d9e9ff;
  font-size: 14px;
}

.users-table tr:last-child td {
  border-bottom: 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.status-badge.active {
  color: #dffcff;
  background: rgba(82, 220, 255, 0.13);
}

.status-badge.inactive {
  color: #ffd8df;
  background: rgba(255, 101, 120, 0.14);
}

.small-action {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: #dff8ff;
  padding: 0 12px;
  font-weight: 900;
}

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 4, 11, 0.76);
  z-index: 30;
}

.modal-card {
  width: min(100%, 540px);
  padding: 24px;
}

.compact-modal {
  width: min(100%, 460px);
}

.status-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(100%, 360px);
  text-align: center;
}

.status-card h3,
.status-card p {
  margin: 0;
}

.status-card p {
  color: var(--muted);
}

.status-spinner {
  width: 54px;
  height: 54px;
  border: 4px solid rgba(82, 220, 255, 0.16);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.modal-copy {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.modal-header,
.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-weight: 900;
}

.modal-actions {
  margin-top: 22px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  max-width: min(420px, calc(100vw - 44px));
  border: 1px solid rgba(82, 220, 255, 0.32);
  border-radius: 14px;
  background: rgba(8, 20, 38, 0.96);
  color: #e8fbff;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  font-weight: 800;
}

.toast.error {
  border-color: rgba(255, 101, 120, 0.42);
  color: #ffd8df;
}

@media (max-width: 920px) {
  .auth-grid {
    grid-template-columns: 1fr;
    align-items: start;
    padding-top: 32px;
  }

  .metric-row,
  .summary-grid,
  .recharge-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .top-nav,
  .tool-panel,
  .auth-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .user-chip,
  .tool-button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .auth-view,
  .workspace,
  .login-card,
  .activity-panel,
  .tool-panel,
  .modal-card {
    padding: 18px;
  }

  .product-panel h1 {
    font-size: 34px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions button {
    width: 100%;
  }

  .developer-brand {
    align-items: flex-start;
    flex-direction: column;
    text-align: left;
  }

  .qr-payment img {
    width: 100%;
    height: auto;
    max-height: 260px;
  }
}
