:root {
  --bg-color: #f5f5f5;
  --container-bg: #ffffff;
  --text-main: #333333;
  --border-color: #eeeeee;
  --color-positive: seagreen;
  --color-negative: crimson;
  --btn-bg: #111111;
  --btn-text: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}

.container {
  background: var(--container-bg);
  padding: 30px;
  width: 100%;
  max-width: 1000px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

h1 {
  margin-bottom: 24px;
  text-align: center;
}

.forms-wrapper {
  display: grid;
  /*grid-template-columns: 1fr 1fr;  Dwie równe kolumny dla formularzy */
  gap: 20px;
  margin-bottom: 20px;
}

form {
  display: flex;
  gap: 10px;
}

input {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: #999;
}

button {
  padding: 10px 16px;
  border: none;
  background: var(--btn-bg);
  color: var(--btn-text);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.2s;
}

button:hover {
  opacity: 0.8;
}

#balanceBox {
  border: 1px solid var(--border-color);
  background-color: #fafafa;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#balanceValue {
  font-size: 28px;
  font-weight: 800;
}

.lists {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Dwie równe kolumny dla list */
  gap: 20px;
}

.list {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
}

.listHeader {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--bg-color);
}

.summaryLabel, .summaryValue {
  font-weight: 800;
  font-size: 18px;
}

.singleItem {
  display: grid;
  grid-template-columns: 1fr auto 36px;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.singleItem:last-child {
  border-bottom: none;
}

.singleItem span:first-child {
  word-break: break-word;
}

.singleItem span:nth-child(2) {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.edit-btn {
  background-color: #666060;
  color: var(--color-negative);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}
.edit-btn:hover {
  background-color: var(--color-negative);
  color: white;
}

.delete-btn {
  background-color: #ffecec;
  color: var(--color-negative);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.delete-btn:hover {
  background-color: var(--color-negative);
  color: white;
}

.positive { color: var(--color-positive); }
.negative { color: var(--color-negative); }
.error {
  color: var(--color-negative);
  font-size: 13px;
  margin-top: 4px;
  min-height: 18px;
}

select {
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  outline: none;
  background-color: white;
  cursor: pointer;
}

.category-badge {
  font-size: 11px;
  background-color: #eef2f5;
  color: #555;
  padding: 3px 8px;
  border-radius: 12px;
  margin-left: 8px;
  font-weight: 500;
  white-space: nowrap; 
}

.actions-wrapper {
    margin-top: 30px;
    display: flex;
    justify-content: center; 
    gap: 15px;
}

.chart-container {
  max-width: 400px; 
  margin: 0 auto 30px auto;
}

.auth-error {
    text-align: center;
    font-size: 16px;
    margin-top: 15px;
}

.user-panel {
    text-align: right;
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

#currentUserDisplay {
    margin-right: 15px;
    font-weight: bold;
}

.logout-btn {
    background-color: #555;
    padding: 8px 16px;
    width: auto;
}

.btn-success {
    background-color: seagreen;
}

.export-btn {
    background-color: #2b6cb0;
}


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

@media (max-width: 600px) {
  .actions-wrapper {
    justify-content: center;
  }
  .danger-btn {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .lists {
    grid-template-columns: 1fr; 
  }
  form {
    flex-direction: column; 
  }
}