:root {
    --bg-primary: #081528;
    --bg-secondary: #101f3b;
    --text-primary: #f4f4f4;
    --text-secondary: #b3b3b3;
    --border: #1a365d;
    --accent: #69afde;

    --sl-spacing-large: 1.5rem;
    --sl-panel-background-color: #101f3b;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  border-radius: 9999px;
  padding: 1.25rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
  &:hover {
    background-color: var(--accent);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

header {
    border-bottom: 1px solid var(--border);
}

.month-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.nav-button {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  border-radius: 9999px;
  padding: 0.5rem 1.25rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
  &:hover {
    background-color: var(--accent);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
}

.current-month {
    font-size: 1.5rem;
    font-weight: bold;
    min-width: 200px;
    text-align: center;
}

.chart-container {
    display: flex;
    gap: 1rem;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 0.5rem;
    min-height: 450px;
    align-items: center;
}

.chart-box {
    flex: 1;
    height: 380px;
    display: flex;
    align-items: center;
}

.chart-box canvas {
    width: 100%;
    max-height: 380px;
}

.legend-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.legend-item.disabled .color-box {
    background-color: #808080 !important;
    position: relative;
}

.legend-item.disabled .color-box::after {
    content: '×';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-primary);
    font-weight: bold;
}

.legend-item.disabled .legend-text {
    opacity: 0.5;
}

.color-box {
    width: 16px;
    height: 16px;
    margin-right: 1rem;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.legend-box {
    flex: 1;
    padding: 0.5rem 2.5rem 0.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.legend-text {
    display: flex;
    justify-content: space-between;
    flex: 1;
}

.amount {
    font-family: monospace;
    color: var(--text-secondary);
}

.no-data {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 2rem;
}

.nav-bar {
    display: flex;
    justify-content: center;
    gap: 1rem;
    align-items: center;
}

/* Table styles */
.expense-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
}

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

.expense-table th {
    background-color: var(--bg-primary);
    font-weight: 600;
}

.expense-table tr:last-child td {
    border-bottom: none;
}

.date-column {
    color: var(--text-secondary);
}

.delete-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.delete-button {
    border-radius: 9999px;
    padding: 6px 10px;
}

.delete-button:hover {
    background-color: rgba(255, 99, 99, 0.1);
    color: #ff6b6b;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

.modal-button {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.modal-button {
    border-radius: 9999px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.modal-button:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modal-button.confirm {
    background-color: #ff6b6b;
    border-color: #ff6b6b;
    color: white;
}

.modal-button:hover {
    opacity: 0.9;
}

.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-item {
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.category-item .delete-button {
    padding: 0.25rem;
    height: 1.5rem;
    width: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-container {
  display: flex;
  gap: 0.5rem;
  input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
  }
}

.export-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.cashflow-container {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: stretch;
}

.cashflow-item {
    flex: 1;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cashflow-item.income {
    background-color: rgba(52, 211, 153, 0.1);
}

.cashflow-item.expenses {
    background-color: rgba(239, 68, 68, 0.1);
}

.cashflow-item.balance {
    background-color: rgba(251, 191, 36, 0.1);
}

.cashflow-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.cashflow-value {
    font-size: 1.4rem;
    font-weight: bold;
}

.cashflow-value.positive {
    color: #2EAB7D;
}

.cashflow-value.negative {
    color: #EF4444;
}

/* Responsive styles */
@media (max-width: 768px) {
    .chart-container {
        flex-direction: column;
        min-height: auto;
        padding: 1rem;
    }

    .chart-box {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 1rem 0;
        margin: auto;
        canvas { max-height: 300px; }
    }

    .legend-box {
        width: 100%;
        padding: 0.5rem;
    }

    .legend-item {
        margin-bottom: 0.5rem;
    }

    .month-navigation {
      gap: 0.2rem;
      .current-month {
        font-size: 1rem;
        text-align: center;
        min-width: 150px;
      }
    }
    
    .nav-button {
        padding: 0.25rem 0.75rem;
        font-size: 1rem;
    }

    .date-column,
    .date-header {
      display: none;
    }

    .expense-table th,
    .expense-table td {
      padding: 0.75rem;
    }
    
    .export-buttons {
      flex-direction: column;
      button { text-align: center; }
    }

    .cashflow-container {
      flex-direction: column;
      gap: 0.5rem;
      .cashflow-item { padding: 0.75rem; }
      .cashflow-value { font-size: 1.2rem; }
    }
}

.form-container {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
}

.expense-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    label {
      font-size: 0.875rem;
      color: var(--text-secondary);
    }
    input, select {
      padding: 0.5rem;
      border: 1px solid var(--border);
      border-radius: 4px;
      background-color: var(--bg-primary);
      color: var(--text-primary);
      font-size: 1rem;
      color-scheme: dark;
      &:focus {
        outline: none;
        border-color: var(--accent);
      }
    }
  }
}

.drawer-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
