* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Heebo', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #0f1419 0%, #1a2332 50%, #0d2818 100%);
  color: #e5e7eb;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

.bg-money {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(34, 197, 94, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(250, 204, 21, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

header {
  text-align: center;
  margin-bottom: 30px;
  animation: fadeIn 0.8s ease-out;
}

h1 {
  font-size: 2.5rem;
  background: linear-gradient(135deg, #fbbf24, #22c55e, #fbbf24);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 3s ease-in-out infinite;
  margin-bottom: 8px;
}

.tagline {
  color: #94a3b8;
  font-style: italic;
  font-size: 1rem;
}

@keyframes shine {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

section {
  max-width: 1000px;
  margin: 0 auto 30px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: #fbbf24;
}

h3 {
  font-size: 1.1rem;
  color: #22c55e;
  margin: 20px 0 12px;
  border-bottom: 1px solid rgba(34, 197, 94, 0.3);
  padding-bottom: 6px;
}

/* BALANCE BOARD */
.balance-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.card {
  padding: 24px;
  border-radius: 16px;
  text-align: center;
  transition: transform 0.2s;
  border: 2px solid;
}

.card:hover { transform: translateY(-4px); }

.card.profit {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.05));
  border-color: #22c55e;
}

.card.loss {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.05));
  border-color: #ef4444;
}

.card.net {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.05));
  border-color: #fbbf24;
}

.card.net.negative {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.05));
  border-color: #ef4444;
}

.label {
  font-size: 1rem;
  color: #94a3b8;
  margin-bottom: 8px;
}

.value {
  font-size: 2.2rem;
  font-weight: 700;
}

.card.profit .value { color: #22c55e; }
.card.loss .value { color: #ef4444; }
.card.net .value { color: #fbbf24; }
.card.net.negative .value { color: #ef4444; }

/* FORM */
.transaction-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row {
  display: flex;
  gap: 12px;
}

.type-btn {
  flex: 1;
  padding: 12px;
  border: 2px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.5);
  color: #94a3b8;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.type-btn.active[data-type="profit"] {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border-color: #22c55e;
}

.type-btn.active[data-type="loss"] {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: #ef4444;
}

input {
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.5);
  color: #e5e7eb;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  direction: rtl;
}

input:focus {
  outline: none;
  border-color: #fbbf24;
}

.add-btn {
  padding: 14px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #0f1419;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
  font-family: inherit;
}

.add-btn:hover { transform: scale(1.02); }
.add-btn:active { transform: scale(0.98); }

/* HISTORY */
#historyList {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: 10px;
  border-right: 4px solid;
  background: rgba(15, 23, 42, 0.5);
}

.transaction-item.profit { border-right-color: #22c55e; }
.transaction-item.loss { border-right-color: #ef4444; }

.transaction-info {
  flex: 1;
}

.transaction-desc {
  font-weight: 600;
  margin-bottom: 4px;
}

.transaction-date {
  font-size: 0.8rem;
  color: #64748b;
}

.transaction-amount {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 12px;
}

.transaction-item.profit .transaction-amount { color: #22c55e; }
.transaction-item.loss .transaction-amount { color: #ef4444; }

.delete-btn {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
}

.delete-btn:hover { background: rgba(239, 68, 68, 0.4); }

.clear-btn {
  width: 100%;
  padding: 10px;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.clear-btn:hover { background: rgba(239, 68, 68, 0.2); }

.empty-state {
  text-align: center;
  color: #64748b;
  padding: 40px 20px;
  font-style: italic;
}

/* LINKS */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.link-card {
  display: block;
  padding: 16px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  text-align: center;
}

.link-card:hover {
  transform: translateY(-4px);
  border-color: #fbbf24;
  box-shadow: 0 8px 20px rgba(251, 191, 36, 0.2);
}

.link-card.shopify {
  background: linear-gradient(135deg, rgba(149, 191, 71, 0.2), rgba(149, 191, 71, 0.05));
  border-color: #95bf47;
}

.link-card .emoji {
  font-size: 2rem;
  margin-bottom: 8px;
}

.link-card .name {
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 4px;
}

.link-card .desc {
  font-size: 0.85rem;
  color: #94a3b8;
}

/* TIPS */
.tips-section ul {
  list-style: none;
}

.tips-section li {
  padding: 12px;
  margin-bottom: 8px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 8px;
  border-right: 3px solid #fbbf24;
}

footer {
  text-align: center;
  padding: 20px;
  color: #64748b;
  font-size: 0.9rem;
}

/* MOBILE */
@media (max-width: 600px) {
  body { padding: 12px; }
  h1 { font-size: 1.8rem; }
  section { padding: 16px; }
  .value { font-size: 1.8rem; }
  .links-grid { grid-template-columns: repeat(2, 1fr); }
}

/* CONFETTI */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  pointer-events: none;
  z-index: 9999;
  animation: fall 2s linear forwards;
}

@keyframes fall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
