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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #ffffff;
  color: #1a1a1a;
  line-height: 1.5;
}

header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem 1rem;
  text-align: center;
}

header h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

header p {
  font-size: 0.95rem;
  opacity: 0.95;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

.warning-banner {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 1rem;
  margin: 1.5rem 0;
  border-radius: 4px;
  font-size: 0.95rem;
}

.warning-banner strong {
  display: block;
  margin-bottom: 0.5rem;
}

section {
  margin: 2rem 0;
}

section h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #667eea;
  padding-bottom: 0.5rem;
}

.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #e0e0e0;
}

.tab-button {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  font-size: 0.95rem;
  cursor: pointer;
  color: #666;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.tab-button.active {
  color: #667eea;
  border-bottom-color: #667eea;
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.upload-area {
  border: 2px dashed #667eea;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  background: #f5f7ff;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-area:hover {
  background: #e8edff;
  border-color: #5568d3;
}

.upload-area.drag-over {
  background: #e8edff;
  border-color: #5568d3;
}

.upload-area svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.upload-area p {
  font-size: 0.95rem;
  color: #666;
}

#file-input {
  display: none;
}

.file-list {
  margin: 1.5rem 0;
  padding: 1rem;
  background: #f9f9f9;
  border-radius: 4px;
}

.file-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem;
  border-bottom: 1px solid #e0e0e0;
  font-size: 0.9rem;
}

.file-item:last-child {
  border-bottom: none;
}

.calculation-result {
  background: #f0f4ff;
  border: 1px solid #d0e0ff;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.result-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.result-item {
  background: white;
  padding: 1rem;
  border-radius: 4px;
  border-left: 3px solid #667eea;
}

.result-label {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.result-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
}

.result-value.currency::after {
  content: ' VND';
  font-size: 0.85rem;
  opacity: 0.7;
}

.overwithheld-warning {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  padding: 1rem;
  margin: 1rem 0;
  color: #721c24;
  font-size: 0.95rem;
}

.overwithheld-warning strong {
  display: block;
  margin-bottom: 0.5rem;
}

.overwithheld-warning a {
  color: #721c24;
  text-decoration: underline;
}

.walkthrough {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.walkthrough ol {
  margin-left: 1.5rem;
  line-height: 1.8;
}

.walkthrough li {
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.walkthrough strong {
  color: #667eea;
}

.cta-button {
  display: inline-flex;
  background: linear-gradient(135deg, #667eea 0%, #5568d3 100%);
  color: white;
  padding: 1rem 2rem;
  border-radius: 8px;
  border: none;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 48px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cta-button:hover {
  background: linear-gradient(135deg, #5568d3 0%, #4555b8 100%);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
  transform: translateY(-2px);
}

.cta-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.cta-button.loading {
  opacity: 0.7;
  pointer-events: none;
}

.result-cta-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
  border: 2px solid #667eea;
  border-radius: 8px;
  text-align: center;
}

.result-cta-section p {
  margin: 0 0 1rem 0;
  color: #333;
  font-size: 0.95rem;
}

footer {
  background: #f5f5f5;
  border-top: 1px solid #e0e0e0;
  padding: 2rem 1rem;
  margin-top: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: #666;
  line-height: 1.6;
}

footer a {
  color: #667eea;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.missing-months {
  background: #fff3cd;
  border-left: 3px solid #ffc107;
  padding: 0.75rem;
  margin: 1rem 0;
  border-radius: 4px;
  font-size: 0.9rem;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: #999;
}

@media (max-width: 768px) {
  header h1 {
    font-size: 1.35rem;
  }

  .result-row {
    grid-template-columns: 1fr;
  }

  .tabs {
    flex-direction: column;
  }

  .tab-button {
    border-bottom: 2px solid #e0e0e0;
    border-right: 3px solid transparent;
    text-align: left;
  }

  .tab-button.active {
    border-bottom: none;
    border-right-color: #667eea;
  }
}

.hidden {
  display: none !important;
}

.usage-notice {
  background: #e7f3ff;
  border-left: 4px solid #2196F3;
  padding: 1rem;
  margin: 1.5rem 0;
  border-radius: 4px;
  font-size: 0.95rem;
}

.usage-notice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.usage-notice-header strong {
  display: block;
}

.usage-notice-toggle {
  background: none;
  border: none;
  color: #2196F3;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: underline;
  padding: 0;
}

.usage-notice-toggle:hover {
  color: #0b7dda;
}
