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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
}

.sidebar-logo {
  padding: 20px 16px 18px;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-logo-link {
  display: block;
  text-decoration: none;
  line-height: 0;
}

.brand-logo {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.brand-logo-sidebar {
  max-height: 52px;
  width: auto;
  margin: 0 auto;
}

.brand-logo-auth {
  max-width: 280px;
  max-height: 88px;
  margin: 0 auto;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item-icon {
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  opacity: 0.85;
}

.nav-item:hover {
  background: var(--bg);
  color: var(--text-secondary);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(5, 150, 105, 0.12);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.sidebar-footer {
  padding: 18px 20px 22px;
  border-top: 1px solid var(--border-light);
}

.balance-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 45%, #F0FDF4 100%);
  color: var(--accent-hover);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(5, 150, 105, 0.18);
  box-shadow: 0 2px 10px rgba(5, 150, 105, 0.1);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  font-family: var(--font);
  position: relative;
  overflow: hidden;
}

.balance-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
  opacity: 0.9;
}

.balance-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.16);
  border-color: rgba(5, 150, 105, 0.28);
}

.balance-badge:active {
  transform: translateY(0);
}

.balance-badge-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.28);
}

.balance-badge-info {
  flex: 1;
  min-width: 0;
}

.balance-badge-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.balance-badge-amount {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-hover);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.balance-badge-arrow {
  font-size: 0.7rem;
  color: var(--accent);
  opacity: 0.55;
  flex-shrink: 0;
  transition: transform var(--transition), opacity var(--transition);
}

.balance-badge:hover .balance-badge-arrow {
  opacity: 0.9;
  transform: translateX(2px);
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.header-user-name {
  font-weight: 500;
  color: var(--text-secondary);
}

.page-content {
  padding: 28px 32px 40px;
  flex: 1;
  max-width: 1400px;
  width: 100%;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(16, 185, 129, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(5, 150, 105, 0.08) 0%, transparent 55%),
    var(--bg);
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 44px 40px;
  width: 100%;
  max-width: 440px;
  border: 1px solid var(--border);
}

.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 0.925rem;
}

.auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 28px;
  padding: 4px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: all var(--transition);
  font-family: var(--font);
}

.auth-tab:hover { color: var(--text-secondary); }

.auth-tab.active {
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-content { padding: 20px 16px 32px; }
  .header { padding: 16px 20px; }
}
