/* Base styles */
:root {
  --primary-color: #4285F4;
  --primary-dark: #3367D6;
  --secondary-color: #34A853;
  --danger-color: #EA4335;
  --warning-color: #FBBC05;
  --text-color: #333333;
  --light-text: #757575;
  --bg-color: #F5F5F5;
  --card-bg: #FFFFFF;
  --border-color: #E0E0E0;
  --header-height: 64px;
  --sidebar-width: 240px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background: var(--bg-color);
  min-height: 100vh;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  margin-bottom: 1rem;
  font-weight: 500;
}

/* Layout */
.container {
  display: flex;
  min-height: calc(100vh - var(--header-height));
}

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 1.5rem;
  background-color: var(--card-bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo h1 {
  font-size: 1.5rem;
  margin-bottom: 0;
  color: var(--primary-color);
}

.user-info {
  display: flex;
  align-items: center;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 1rem;
}

.user-details {
  display: flex;
  flex-direction: column;
  margin-right: 1.5rem;
}

.user-name {
  font-weight: 500;
}

.user-email {
  font-size: 0.8rem;
  color: var(--light-text);
}

.logout-btn {
  padding: 0.5rem 1rem;
  background-color: var(--danger-color);
  color: white;
  border-radius: 4px;
  font-size: 0.9rem;
}

.logout-btn:hover {
  background-color: #d73125;
  text-decoration: none;
}

.sidebar {
  width: var(--sidebar-width);
  background-color: var(--card-bg);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem 0;
}

.nav-menu {
  list-style: none;
}

.nav-menu li {
  margin-bottom: 0.5rem;
}

.nav-menu a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  color: var(--text-color);
  transition: background-color 0.2s;
}

.nav-menu a:hover {
  background-color: rgba(0, 0, 0, 0.05);
  text-decoration: none;
}

.nav-menu .active a {
  background-color: rgba(66, 133, 244, 0.1);
  color: var(--primary-color);
  border-left: 3px solid var(--primary-color);
}

.icon {
  margin-right: 1rem;
  font-size: 1.25rem;
}

.content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

.content-fullwidth {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Dashboard Styles */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-value {
  font-size: 2rem;
  font-weight: 600;
  margin: 1rem 0;
  color: var(--primary-color);
}

.stat-label {
  color: var(--light-text);
  margin-bottom: 0.5rem;
}

.card-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--primary-color);
  font-weight: 500;
}

.dashboard-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.widget {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.activity-list {
  list-style: none;
}

.activity-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.activity-list li:last-child {
  border-bottom: none;
}

.activity-time {
  font-size: 0.8rem;
  color: var(--light-text);
  margin-bottom: 0.25rem;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.quick-link {
  display: flex;
  align-items: center;
  padding: 1rem;
  background-color: rgba(0, 0, 0, 0.03);
  border-radius: 6px;
  transition: background-color 0.2s;
}

.quick-link:hover {
  background-color: rgba(0, 0, 0, 0.06);
  text-decoration: none;
}

.link-icon {
  margin-right: 0.75rem;
  font-size: 1.25rem;
}

/* Finances Styles */
.finances-container {
  max-width: 1200px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-actions {
  display: flex;
  gap: 1rem;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-secondary {
  background-color: #f5f5f5;
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: #e0e0e0;
}

.btn-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.finance-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.summary-card {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.summary-amount {
  font-size: 2rem;
  font-weight: 600;
  margin: 1rem 0;
}

.positive .summary-amount {
  color: var(--secondary-color);
}

.negative .summary-amount {
  color: var(--danger-color);
}

.summary-period {
  color: var(--light-text);
  font-size: 0.9rem;
}

.finance-data {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  font-weight: 500;
  color: var(--light-text);
}

.amount {
  font-weight: 500;
}

.amount.positive {
  color: var(--secondary-color);
}

.amount.negative {
  color: var(--danger-color);
}

.finance-additional {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.finance-widget {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.report-links {
  list-style: none;
  margin-top: 1rem;
}

.report-links li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.report-links li:last-child {
  border-bottom: none;
}

.goal {
  margin-bottom: 1rem;
}

.goal-label {
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 10px;
  background-color: #f5f5f5;
  border-radius: 5px;
  overflow: hidden;
}

.progress {
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 5px;
  text-align: center;
  font-size: 0.7rem;
  color: white;
}

/* Login Page */
.login-page {
  background-color: #f5f5f5;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-container {
  width: 100%;
  max-width: 400px;
}

.login-box {
  background-color: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.login-box .logo {
  margin-bottom: 2rem;
}

.login-description {
  margin-bottom: 2rem;
  color: var(--light-text);
}

.google-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  color: var(--text-color);
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  font-weight: 500;
  margin: 0 auto;
  transition: background-color 0.2s;
  max-width: 80%;
}

.google-signin-btn:hover {
  background-color: #f8f8f8;
  text-decoration: none;
}

.google-icon {
  background-color: white;
  color: var(--primary-color);
  font-weight: bold;
  margin-right: 1rem;
}

.login-info {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--light-text);
}

/* Error Pages */
.error-page {
  background-color: #f5f5f5;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.error-container {
  width: 100%;
  max-width: 600px;
}

.error-box {
  background-color: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.error-icon {
  font-size: 3rem;
  margin: 1rem 0;
}

.error-message {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.error-details {
  color: var(--light-text);
  margin-bottom: 2rem;
}

.error-code {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background-color: #f5f5f5;
  border-radius: 4px;
  font-weight: 500;
  margin-bottom: 1rem;
}

.error-stack {
  text-align: left;
  background-color: #f5f5f5;
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.error-stack pre {
  font-size: 0.8rem;
  white-space: pre-wrap;
}

.error-actions {
  margin-top: 1.5rem;
}

.error-actions .btn {
  padding: 0.75rem 1.5rem;
  background-color: var(--primary-color);
  color: white;
}

/* Footer */
.page-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--light-text);
  font-size: 0.9rem;
  border-top: 1px solid var(--border-color);
  margin-top: 2rem;
}

.version {
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
  }
  
  .dashboard-stats,
  .dashboard-widgets,
  .finance-summary,
  .finance-additional {
    grid-template-columns: 1fr;
  }
  
  .quick-links {
    grid-template-columns: 1fr;
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .page-actions {
    margin-top: 1rem;
  }
}