:root {
  --primary-red: #d92d3a;
  --primary-blue: #1f4fb3;
  --dark-blue: #10214a;
  --navy: #0b1738;
  --surface: #f4f7fb;
  --panel: #ffffff;
  --muted: #6a7892;
  --line: #e2e8f0;
  --success: #1ea56a;
  --danger: #d92d3a;
  --shadow: 0 16px 36px rgba(16, 33, 74, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(135deg, #ebf1ff 0%, #f8fafd 100%);
  color: var(--dark-blue);
}

button {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.dashboard {
  position: relative;
  width: min(100%, 1100px);
  padding-bottom: 32px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  gap: 12px;
}

.brand-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--navy);
}

.brand-mini-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(46px, 5vw, 78px);
  height: clamp(28px, 4vw, 52px);
  padding: 0 10px;
  font-size: clamp(1rem, 1.8vw, 1.5rem);
  line-height: 1;
  border-radius: 6px 0 0 6px;
  background: linear-gradient(135deg, #e0323e 0%, #c2142b 100%);
  color: #fff;
  letter-spacing: -0.08em;
}

.mini-word {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-blue);
  font-weight: 900;
  letter-spacing: -0.08em;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  margin-left: -4px;
}

.brand-mini-reg {
  color: var(--primary-blue);
  font-weight: 700;
  position: relative;
  top: clamp(-6px, -0.6vw, -10px);
  margin-left: 4px;
  font-size: clamp(0.7rem, 1vw, 0.95rem);
}

.profile-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(31, 79, 179, 0.06);
  border: 1px solid rgba(31, 79, 179, 0.1);
}

.profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-red), var(--primary-blue));
  color: #fff;
  font-weight: 700;
}

.profile-meta {
  display: grid;
  gap: 2px;
  text-align: left;
}

.profile-name {
  color: var(--navy);
  font-weight: 700;
  font-size: 0.96rem;
}

.profile-meta small {
  color: var(--muted);
  font-size: 0.7rem;
}

.balance-card {
  background: linear-gradient(135deg, var(--primary-blue), #123b9f 60%, #0b1738);
  border-radius: 24px;
  padding: 24px 22px;
  box-shadow: var(--shadow);
  color: white;
}

.card-header,
.hold-row,
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.72rem;
  font-weight: 700;
}

.balance-card h2 {
  margin: 18px 0 14px;
  font-size: clamp(2.2rem, 6vw, 3.3rem);
}

.hold-row {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
}

.actions-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 18px;
  margin: 24px 0;
}

.action-button {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 20px rgba(25, 47, 103, 0.08);
  padding: 20px 18px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: not-allowed;
  opacity: 0.7;
}

.action-button span {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
}

.action-button small {
  color: var(--muted);
  font-size: 0.78rem;
}

.action-button.disabled {
  background: #eef3fb;
}

.action-secondary {
  border-left: 4px solid var(--primary-red);
}

.content-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 20px 18px;
}

.activity-panel {
  min-height: 260px;
}

.panel-header h3 {
  margin: 0;
  color: var(--navy);
}

.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.activity-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.activity-list li:last-child {
  border-bottom: none;
}

.activity-list strong {
  display: block;
  font-size: 0.92rem;
}

.inflow {
  color: var(--success);
  font-weight: 700;
}

.outflow {
  color: var(--danger);
  font-weight: 700;
}

.chat-popover {
  position: absolute;
  right: 20px;
  bottom: 16px;
  width: min(240px, 32vw);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 22px;
  box-shadow: 0 18px 30px rgba(16, 33, 74, 0.16);
  min-height: 220px;
  overflow: hidden;
  border: 1px solid rgba(16, 33, 74, 0.08);
  display: flex;
  flex-direction: column;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  background: rgba(244, 247, 251, 0.9);
  border-bottom: 1px solid rgba(16, 33, 74, 0.08);
}

.chat-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-red), var(--primary-blue));
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.chat-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2fc972;
  box-shadow: 0 0 0 3px rgba(47, 201, 114, 0.12);
}

.chat-name {
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 700;
}

.chat-body {
  flex: 1;
  min-height: 110px;
  background: transparent;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.chat-message {
  max-width: 85%;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 0.74rem;
  line-height: 1.4;
  word-break: break-word;
}

.chat-message.user {
  margin-left: auto;
  background: linear-gradient(135deg, var(--primary-red), var(--primary-blue));
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-message.bot {
  background: #edf3ff;
  color: var(--navy);
  border-bottom-left-radius: 4px;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(16, 33, 74, 0.08);
  background: rgba(244, 247, 251, 0.82);
}

.chat-form input {
  border: 1px solid rgba(16, 33, 74, 0.08);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.76rem;
  color: var(--navy);
}

.chat-form button {
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-red), var(--primary-blue));
  color: white;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 9px 12px;
  cursor: pointer;
}

@media (max-width: 720px) {
  .content-grid,
  .actions-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 12px;
  }

  .balance-card,
  .panel,
  .chat-popover {
    border-radius: 18px;
  }

  .chat-popover {
    position: static;
    width: 100%;
    margin-top: 18px;
  }
}
