:root {
  --primary-color: #4285f4;
  --secondary-color: #34a853;
  --warning-color: #fbbc05;
  --danger-color: #ea4335;
  --text-color: #5f6368;
  --light-text: #9aa0a6;
  --border-color: #dadce0;
  --card-bg: #ffffff;
  --body-bg: #f1f3f4;
  --header-height: 64px;
  --sidebar-width: 240px;
}

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

body {
  font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
  background-color: var(--body-bg);
  color: var(--text-color);
  line-height: 1.6;
}

/* Header Styles */
header {
  height: var(--header-height);
  background-color: var(--card-bg);
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.header-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--primary-color);
}

.header-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.refresh-button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.refresh-button:hover {
  background: #3b78e7;
}

/* Main Container */
.container {
  margin-top: var(--header-height);
  padding: 24px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

/* Dashboard Summary Section */
.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.summary-card {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--light-text);
  margin-bottom: 12px;
}

.card-value {
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

.trend-indicator {
  font-size: 14px;
  margin-left: 8px;
  display: flex;
  align-items: center;
}

.trend-up {
  color: var(--danger-color);
}

.trend-down {
  color: var(--secondary-color);
}

.card-subtitle {
  font-size: 12px;
  color: var(--light-text);
}

/* Accounts Grid */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.account-card {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
}

.account-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.account-name {
  font-size: 18px;
  font-weight: 500;
}

.account-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 16px;
  background-color: var(--primary-color);
  color: white;
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 12px;
  color: var(--light-text);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 16px;
  font-weight: 500;
}

.last-updated {
  font-size: 12px;
  color: var(--light-text);
  margin-top: 16px;
  text-align: right;
}

/* Chart Sections */
.chart-section {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.chart-title {
  font-size: 18px;
  font-weight: 500;
}

.chart-container {
  height: 300px;
  position: relative;
}

/* Comparison Section */
.comparison-section {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
}

.comparison-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.comparison-form {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-label {
  font-size: 14px;
  font-weight: 500;
}

.form-control {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
}

.compare-button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  height: 38px;
  align-self: flex-end;
}

.compare-button:hover {
  background: #3b78e7;
}

.comparison-results {
  display: none;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.comparison-table th,
.comparison-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
  font-weight: 500;
  color: var(--light-text);
}

/* Status Messages */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  display: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error-message {
  background-color: #fde7e7;
  border: 1px solid var(--danger-color);
  color: var(--danger-color);
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 16px;
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .dashboard-summary,
  .accounts-grid {
    grid-template-columns: 1fr;
  }
  
  .comparison-form {
    flex-direction: column;
  }
  
  .container {
    padding: 16px;
  }
  
  .chart-container {
    height: 250px;
  }
}

/* Utility Classes */
.flex {
  display: flex;
}

.align-center {
  align-items: center;
}

.mt-4 {
  margin-top: 16px;
}

.hidden {
  display: none;
}

.visible {
  display: block;
}
