:root {
  /* Nature/Growth Color Palette */
  --primary: #4A7C59;
  --primary-light: #5E9E6E;
  --primary-dark: #3A6347;
  --secondary: #6B9E9B;
  --secondary-light: #8FBAB7;
  --accent: #E8A54B;
  --accent-hover: #D4922F;
  --accent-light: rgba(232, 165, 75, 0.15);

  /* Text Colors */
  --text-primary: #2D3436;
  --text-secondary: #636E72;
  --text-tertiary: #A4A9AD;
  --text-on-dark: #FAFAF8;

  /* Background Colors */
  --bg-warm-white: #FAFAF8;
  --bg-soft-cream: #F5F4F0;
  --bg-muted-sage: #E8EDE9;

  /* Glass morphism */
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-bg-strong: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(74, 124, 89, 0.15);
  --glass-border-light: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 8px 32px rgba(45, 52, 54, 0.08);
  --glass-shadow-hover: 0 16px 48px rgba(45, 52, 54, 0.12);
  --blur: 20px;
  --blur-strong: 40px;

  /* Nature-inspired background */
  --bg-gradient: linear-gradient(135deg, #E8EDE9 0%, #F5F4F0 50%, #FAFAF8 100%);
  --bg-mesh:
    radial-gradient(at 20% 20%, rgba(74, 124, 89, 0.08) 0px, transparent 50%),
    radial-gradient(at 80% 10%, rgba(107, 158, 155, 0.06) 0px, transparent 50%),
    radial-gradient(at 10% 60%, rgba(232, 165, 75, 0.04) 0px, transparent 50%),
    radial-gradient(at 90% 70%, rgba(74, 124, 89, 0.05) 0px, transparent 50%),
    radial-gradient(at 50% 90%, rgba(107, 158, 155, 0.04) 0px, transparent 50%),
    linear-gradient(180deg, #FAFAF8 0%, #F5F4F0 50%, #E8EDE9 100%);

  /* Legacy support */
  --green: #4A7C59;
  --green-dark: #3A6347;
  --yellow: #E8A54B;
  --red: #E17055;

  /* Border radius */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
               "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  background: var(--bg-mesh);
  min-height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

/* Glass Panel Base */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
}

.glass-strong {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--blur-strong));
  -webkit-backdrop-filter: blur(var(--blur-strong));
}

/* Sidebar */
aside {
  width: 280px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--blur-strong));
  -webkit-backdrop-filter: blur(var(--blur-strong));
  border-right: 1px solid var(--glass-border);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.brand {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
}

.nav a {
  text-decoration: none;
  color: var(--text-secondary);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  font-weight: 500;
}

.nav a.active,
.nav a:hover {
  background: rgba(74, 124, 89, 0.1);
  color: var(--primary);
}

.upgrade {
  margin-top: auto;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(74, 124, 89, 0.25);
}

.upgrade:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(74, 124, 89, 0.35);
}

/* Main area */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 32px;
  gap: 24px;
  overflow-y: auto;
}

/* Greeting */
.greeting {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

/* Editor / Card */
.editor {
  flex: 1;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow);
  padding: 32px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.editor:hover {
  box-shadow: var(--glass-shadow-hover);
}

.editor-header {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 28px;
  color: var(--text-primary);
  letter-spacing: -0.4px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.last-updated {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0;
}

.refresh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: rgba(74, 124, 89, 0.1);
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.refresh-btn:hover {
  background: rgba(74, 124, 89, 0.2);
  transform: rotate(45deg);
}

.refresh-btn:active {
  transform: rotate(180deg);
}

.refresh-btn.spinning svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.editor textarea {
  flex: 1;
  resize: none;
  border: none;
  outline: none;
  font-size: 16px;
  line-height: 1.7;
  font-family: inherit;
  color: var(--text-primary);
  background: transparent;
}

.editor textarea::placeholder {
  color: var(--text-tertiary);
}

/* Suggestions panel */
.suggestions {
  width: 340px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.suggestions h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.suggestion {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
}

.suggestion:hover {
  background: rgba(255, 255, 255, 0.8);
}

.suggestion strong {
  color: var(--primary);
  font-weight: 600;
}

.apply-btn {
  align-self: flex-start;
  background: rgba(74, 124, 89, 0.1);
  color: var(--primary);
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.apply-btn:hover {
  background: rgba(74, 124, 89, 0.2);
}

/* Buttons */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(74, 124, 89, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(74, 124, 89, 0.35);
}

.btn-secondary {
  background: rgba(74, 124, 89, 0.1);
  color: var(--primary);
}

.btn-secondary:hover {
  background: rgba(74, 124, 89, 0.2);
}

.btn-danger {
  background: linear-gradient(135deg, var(--red) 0%, #C0453A 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(225, 112, 85, 0.25);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(225, 112, 85, 0.35);
}

input[type="checkbox"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.popup {
  display: none;
  position: absolute;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  padding: 16px;
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-md);
  z-index: 1000;
}

/* Metrics */
.metrics {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}

.metric {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.metric-title {
  font-size: 13px;
  margin-bottom: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.circle {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(74, 124, 89, 0.2);
}

.circle-value {
  position: absolute;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Login/Signup Cards */
.login-card {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--blur-strong));
  -webkit-backdrop-filter: blur(var(--blur-strong));
  border: 1px solid var(--glass-border);
  padding: 48px 40px;
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 64px rgba(45, 52, 54, 0.12);
  width: 480px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.login-card h2 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-card label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.login-card input[type="email"],
.login-card input[type="password"],
.login-card input[type="text"],
.login-card select {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
  color: var(--text-primary);
  width: 100%;
}

.login-card select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234A7C59' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}

.login-card input[type="email"]:focus,
.login-card input[type="password"]:focus,
.login-card input[type="text"]:focus,
.login-card select:focus {
  background: rgba(255, 255, 255, 1);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(74, 124, 89, 0.1);
}

.login-card input[type="email"]::placeholder,
.login-card input[type="password"]::placeholder,
.login-card input[type="text"]::placeholder {
  color: var(--text-tertiary);
}

/* Two-column row for name fields */
.login-card .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.login-card .field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Section divider inside the card form */
.login-card .form-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--glass-border);
  margin-top: 4px;
}

.login-card input[type="submit"] {
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  padding: 16px 0;
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(74, 124, 89, 0.3);
  font-family: inherit;
  margin-top: 8px;
}

.login-card input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(74, 124, 89, 0.4);
}

.login-card .footer {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

.login-card .footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.login-card .footer a:hover {
  text-decoration: underline;
}

/* Integrations Title */
.integrations-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

/* Status Panel */
.status-panel {
  display: flex;
  justify-content: space-evenly;
  margin-bottom: 32px;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
}

.status-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex: 1;
  min-width: 120px;
  max-width: 180px;
  text-align: center;
}

/* Fruit-styled metric display */
.status-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  box-shadow:
    0 8px 32px rgba(74, 124, 89, 0.25),
    inset 0 -8px 16px rgba(0, 0, 0, 0.1),
    inset 0 8px 16px rgba(255, 255, 255, 0.25);
  transition: all 0.4s ease;
  position: relative;
  margin-top: 20px;
}

/* Fruit highlight shine */
.status-circle::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 12px;
  width: 24px;
  height: 18px;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.55) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 2;
}

/* Subtle glow effect */
.status-circle::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  border-radius: 50%;
  background: inherit;
  filter: blur(12px);
  opacity: 0.35;
  z-index: -1;
}

/* Apple stem */
.fruit-stem {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 14px;
  background: linear-gradient(180deg, #5D4037 0%, #8D6E63 40%, #6D4C41 100%);
  border-radius: 2px 2px 3px 3px;
  z-index: 3;
  box-shadow: inset -1px 0 2px rgba(0, 0, 0, 0.2);
}

/* Apple leaf */
.fruit-leaf {
  position: absolute;
  top: -10px;
  left: calc(50% + 4px);
  width: 20px;
  height: 12px;
  background: linear-gradient(135deg, #66BB6A 0%, #43A047 50%, #388E3C 100%);
  border-radius: 0 80% 20% 80%;
  transform: rotate(25deg);
  z-index: 2;
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Leaf vein */
.fruit-leaf::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 20%;
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(46, 125, 50, 0.5) 50%, transparent 100%);
  transform: translateY(-50%);
}

/* Value text inside circles */
.circle-value-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  z-index: 4;
}

/* Hover effect for fruits */
.status-item:hover .status-circle {
  transform: translateY(-4px) scale(1.03);
  box-shadow:
    0 12px 40px rgba(74, 124, 89, 0.35),
    inset 0 -8px 16px rgba(0, 0, 0, 0.1),
    inset 0 8px 16px rgba(255, 255, 255, 0.3);
}

.status-item:hover .fruit-leaf {
  transform: rotate(20deg);
  transition: transform 0.3s ease;
}

/* Metric Values */
.editor p {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 8px 0;
}

.editor p span {
  font-weight: 600;
  color: var(--text-primary);
}

/* Metric info tooltip */
.metric-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(74, 124, 89, 0.15);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
  cursor: help;
  transition: all 0.2s ease;
}

.metric-info:hover {
  background: var(--primary);
  color: white;
}

/* Trends Section */
.trends-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--glass-border);
}

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

.trends-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.trends-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.chart-container {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 20px;
  min-height: 200px;
  position: relative;
}

.chart-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-tertiary);
  font-size: 14px;
}

.chart-svg {
  width: 100%;
  height: 180px;
}

.chart-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot {
  stroke-width: 2;
  stroke: white;
}

.chart-label {
  font-size: 11px;
  fill: var(--text-tertiary);
  text-anchor: middle;
}

.chart-grid {
  stroke: var(--glass-border);
  stroke-dasharray: 4 4;
}

.chart-no-data {
  text-anchor: middle;
  fill: var(--text-tertiary);
  font-size: 14px;
}

/* Loading animation */
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
  color: var(--text-tertiary) !important;
}

.circle-value-text.loading {
  font-size: 14px;
}
