:root {
  --primary: #1a6b3c;
  --accent: #e8f5e9;
  --danger: #c62828;
  --neutral: #f5f5f5;
  --text: #333;
  --border: #ddd;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: #fafafa;
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 3px solid var(--primary);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header h1 {
  font-size: 32px;
  color: var(--primary);
}

.header-actions {
  display: flex;
  gap: 10px;
}

.icon-toggle {
  margin-right: 0;
}

/* Summary Section */
.summary-section {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.summary-card {
  flex: 1;
  min-width: 200px;
  padding: 24px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-align: center;
  border-left: 4px solid var(--primary);
}

.summary-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #666;
  margin-bottom: 12px;
  font-weight: 600;
}

.summary-value {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary);
}

.balance-card .summary-value {
  color: #4caf50;
}

.balance-card.negative .summary-value {
  color: var(--danger);
}

/* Form Section */
.form-section {
  background: white;
  padding: 28px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 40px;
}

.import-section {
  background: white;
  padding: 28px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 40px;
}

.hidden {
  display: none;
}

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

.close-panel-btn {
  border: 1px solid var(--border);
  background: white;
  color: #444;
  border-radius: 4px;
  width: 30px;
  height: 30px;
  font-weight: 700;
  cursor: pointer;
}

.close-panel-btn:hover {
  background: var(--neutral);
}

.import-section h2 {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 20px;
}

.import-help {
  margin-bottom: 16px;
  color: #555;
}

.import-status {
  margin-top: 12px;
  font-size: 14px;
}

.import-status.success {
  color: var(--primary);
}

.import-status.error {
  color: var(--danger);
}

.form-section h2 {
  margin-bottom: 0;
  color: var(--primary);
  font-size: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 107, 60, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-right: 10px;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: #145230;
}

.btn-secondary {
  background-color: var(--neutral);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background-color: #e0e0e0;
}

.btn-danger {
  background-color: var(--danger);
  color: white;
  padding: 6px 12px;
  font-size: 12px;
}

.btn-danger:hover {
  background-color: #a01e1e;
}

.btn-edit {
  background-color: #1976d2;
  color: white;
  padding: 6px 12px;
  font-size: 12px;
}

.btn-edit:hover {
  background-color: #1565c0;
}

/* History Section */
.history-section {
  background: white;
  padding: 28px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-height: 55vh;
  display: flex;
  flex-direction: column;
}

.history-section h2 {
  margin-bottom: 24px;
  color: var(--primary);
  font-size: 20px;
}

.table-responsive {
  flex: 1;
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background-color: var(--accent);
}

th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: var(--primary);
  border-bottom: 2px solid var(--border);
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

tbody tr:hover {
  background-color: var(--accent);
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 16px;
  display: none;
}

.empty-state.show {
  display: block;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }

  .summary-section {
    flex-direction: column;
  }

  .summary-card {
    min-width: 100%;
  }

  .form-section,
  .history-section {
    padding: 20px;
  }

  .header h1 {
    font-size: 24px;
  }

  .header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .form-section h2,
  .history-section h2 {
    font-size: 18px;
  }

  table {
    font-size: 14px;
  }

  th,
  td {
    padding: 10px 8px;
  }

  .btn {
    padding: 8px 16px;
    font-size: 12px;
  }

  .action-buttons {
    flex-direction: column;
  }
}
