* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #f0f2f5; color: #333; line-height: 1.6; }
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
header { text-align: center; margin-bottom: 20px; }
header h1 { color: #2c3e50; font-size: 2rem; }
.subtitle { color: #7f8c8d; }
.user-bar { display: flex; justify-content: space-between; align-items: center; background: white; padding: 12px 20px; border-radius: 10px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.user-bar .user-info { display: flex; align-items: center; gap: 10px; }
.user-bar .avatar { width: 40px; height: 40px; border-radius: 50%; background: #3498db; color: white; display: flex; align-items: center; justify-content: center; font-weight: bold; }
.logout-btn { background: #e74c3c; padding: 8px 16px; font-size: 14px; }
.main-nav { display: flex; gap: 10px; margin-bottom: 25px; justify-content: center; flex-wrap: wrap; }
.nav-btn { padding: 12px 30px; background: white; color: #2c3e50; border: 2px solid #3498db; border-radius: 30px; cursor: pointer; font-weight: 600; }
.nav-btn.active, .nav-btn:hover { background: #3498db; color: white; }
.page { display: none; }
.page.active { display: block; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 15px; margin-bottom: 25px; }
.card { background: white; padding: 20px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.card h3 { font-size: 0.9rem; color: #7f8c8d; margin-bottom: 8px; }
.card .amount { font-size: 1.6rem; font-weight: bold; color: #2c3e50; }
.card.income .amount { color: #27ae60; }
.card.expense .amount { color: #e74c3c; }
.section { background: white; padding: 20px; border-radius: 10px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.section h2, .section h3 { margin-bottom: 15px; color: #2c3e50; }
.form-inline { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; align-items: center; }
.form-inline input, .form-inline select { flex: 1; min-width: 150px; padding: 10px; border: 1px solid #ddd; border-radius: 6px; }
.form-inline label { font-weight: 500; color: #555; }
button { padding: 10px 20px; background: #3498db; color: white; border: none; border-radius: 6px; cursor: pointer; font-weight: 500; }
button:hover { background: #2980b9; }
.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.account-card { background: #f8f9fa; padding: 15px; border-radius: 8px; border-left: 4px solid #3498db; position: relative; }
.account-card .name { font-weight: bold; color: #2c3e50; }
.account-card .type { font-size: 0.8rem; color: #7f8c8d; text-transform: uppercase; }
.account-card .balance { font-size: 1.3rem; color: #27ae60; margin-top: 8px; font-weight: bold; }
.account-card .delete { position: absolute; top: 8px; right: 8px; background: #e74c3c; padding: 4px 8px; font-size: 0.75rem; color: white; }
.tabs { display: flex; gap: 5px; margin-bottom: 15px; border-bottom: 2px solid #ecf0f1; flex-wrap: wrap; }
.tab { background: transparent; color: #7f8c8d; padding: 10px 20px; border: none; border-bottom: 3px solid transparent; }
.tab.active { color: #3498db; border-bottom-color: #3498db; }
.tx-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.tx-form input, .tx-form select { padding: 10px; border: 1px solid #ddd; border-radius: 6px; }
.tx-form button { grid-column: 1 / -1; }
.tx-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-bottom: 1px solid #ecf0f1; flex-wrap: wrap; gap: 10px; }
.tx-item:last-child { border-bottom: none; }
.tx-info .tx-type { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; margin-right: 8px; }
.tx-type.income { background: #d4edda; color: #155724; }
.tx-type.expense { background: #f8d7da; color: #721c24; }
.tx-type.transfer { background: #fff3cd; color: #856404; }
.tx-desc { color: #555; font-size: 0.9rem; margin-top: 4px; }
.tx-amount { font-weight: bold; font-size: 1.1rem; }
.tx-amount.positive { color: #27ae60; }
.tx-amount.negative { color: #e74c3c; }
.tx-amount.neutral { color: #f39c12; }
.tx-date { font-size: 0.8rem; color: #95a5a6; }
.tx-delete { background: #e74c3c; padding: 4px 10px; font-size: 0.8rem; margin-left: 10px; color: white; }
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
canvas { max-height: 350px; }
.auth-page { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-container { width: 100%; max-width: 450px; }
.auth-card { background: white; border-radius: 16px; padding: 40px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.auth-header { text-align: center; margin-bottom: 30px; }
.auth-header h1 { font-size: 3rem; margin-bottom: 10px; }
.auth-header h2 { color: #2c3e50; margin-bottom: 8px; }
.auth-header p { color: #7f8c8d; }
.auth-form { display: flex; flex-direction: column; gap: 15px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-weight: 500; color: #2c3e50; font-size: 14px; }
.form-group input { padding: 12px 15px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 16px; }
.form-group input:focus { outline: none; border-color: #3498db; }
.form-group .hint { color: #95a5a6; font-size: 12px; }
.btn-primary { padding: 14px; background: #3498db; color: white; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; }
.btn-primary:hover { background: #2980b9; }
.btn-primary:disabled { background: #95a5a6; cursor: not-allowed; }
.btn-secondary { padding: 12px; background: transparent; color: #7f8c8d; border: 1px solid #ddd; border-radius: 8px; cursor: pointer; }
.btn-secondary:hover { background: #f8f9fa; }
.auth-footer { text-align: center; color: #7f8c8d; font-size: 14px; margin-top: 10px; }
.auth-footer a { color: #3498db; text-decoration: none; font-weight: 600; }
.auth-message { margin-top: 15px; padding: 12px; border-radius: 8px; text-align: center; display: none; }
.auth-message.error { display: block; background: #f8d7da; color: #721c24; }
.auth-message.success { display: block; background: #d4edda; color: #155724; }
.auth-message.info { display: block; background: #d1ecf1; color: #0c5460; }
@media (max-width: 768px) {
  .container { padding: 10px; }
  header h1 { font-size: 1.5rem; }
  .summary { grid-template-columns: 1fr 1fr; }
  .form-inline { flex-direction: column; }
  .form-inline input, .form-inline select { width: 100%; }
  .tx-form { grid-template-columns: 1fr; }
  .accounts-grid { grid-template-columns: 1fr; }
  .charts-row { grid-template-columns: 1fr; }
  .auth-card { padding: 25px; }
}