:root {
  --bg-app: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #334155;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;

  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --primary-glow: rgba(139, 92, 246, 0.3);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);

  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);

  --warning: #f59e0b;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-card:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.15);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Outfit", sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Utilities */
.hidden {
  display: none !important;
}
.screen {
  display: none;
  height: 100vh;
  width: 100%;
}
.screen.active {
  display: flex;
  flex-direction: column;
}

/* Login Screen */
#login-screen {
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at top right, #1e1b4b, var(--bg-app));
}

.login-card {
  background: var(--bg-card);
  padding: 3rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow);
  width: 100%;
  max-width: 400px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.login-card .brand {
  margin-bottom: 2.5rem;
}
.login-card .logo-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.login-card h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.login-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.input-group {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  transition: var(--transition);
  border: 1px solid transparent;
}

.input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.input-group i {
  color: var(--text-muted);
}
.input-group input {
  background: transparent;
  border: none;
  color: var(--text-main);
  width: 100%;
  outline: none;
  font-family: inherit;
  font-size: 1rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  width: 100%;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.error-msg {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 1rem;
}

/* Dashboard App */
#dashboard-screen {
  height: auto;
  min-height: 100vh;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-small {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-main);
}
.brand-small i {
  color: var(--primary);
  font-size: 1.25rem;
}

.actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}
.status-badge.online .dot {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}
.status-badge.offline .dot {
  background: var(--danger);
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: var(--transition);
}
.icon-btn:hover {
  color: var(--danger);
}

.icon-btn-small {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: var(--transition);
  border-radius: var(--radius-sm);
}
.icon-btn-small:hover {
  color: var(--primary);
  background: rgba(139, 92, 246, 0.1);
}

.dashboard-content {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.welcome-section {
  margin-bottom: 2rem;
}
.welcome-section h2 {
  font-size: 1.75rem;
  font-weight: 600;
}
.welcome-section .subtitle {
  color: var(--text-muted);
}

/* Summary Cards */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: var(--transition);
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.summary-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.1);
}

.icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.income .icon-box {
  background: var(--success-bg);
  color: var(--success);
}
.expense .icon-box {
  background: var(--danger-bg);
  color: var(--danger);
}
.balance .icon-box {
  background: rgba(139, 92, 246, 0.1);
  color: var(--primary);
}

.card-info .label {
  color: var(--text-muted);
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.25rem;
}
.card-info h3 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
}

.income h3 {
  color: var(--success);
}
.expense h3 {
  color: var(--danger);
}

/* Grid Layout */
.grid-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .grid-layout {
    grid-template-columns: 1fr;
  }
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 500;
}
.badge {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* List Items */
.list-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.account-item,
.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  transition: var(--transition);
}

.account-item:hover,
.transaction-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.item-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.item-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
}

.item-info h4 {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.1rem;
}
.item-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.item-amount {
  font-weight: 600;
  font-size: 0.95rem;
}
.amount-pos {
  color: var(--success);
}
.amount-neg {
  color: var(--text-main);
} /* Expenses standard white */

/* Skeleton Loading */
.skeleton-item {
  height: 60px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    opacity: 0.5;
  }
}

/* Responsive */
@media (max-width: 600px) {
  .dashboard-content {
    padding: 1.5rem;
  }
  .top-bar {
    padding: 1rem 1.5rem;
  }
  .summary-cards {
    grid-template-columns: 1fr;
  }
  .login-card {
    padding: 2rem;
  }
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--text-muted);
  text-align: center;
}
.empty-state i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}
.empty-state p {
  font-size: 0.9rem;
}
