/* ==========================================================================
   Small Wallet CSS
   ========================================================================== */

/* ==========================================================================
   1. Color Palette
   ========================================================================== */

:root {
  /* Brand Colors */
  --color-red: #F82315;
  --color-blue: #23BBF7;
  --color-green: #45B349;
  --color-yellow: #EDC515;
  --color-dark-blue: #4A7BF7;

  /* Semantic Colors */
  --color-error: var(--color-red);
  --color-success: var(--color-green);
  --color-warning: var(--color-yellow);
  --color-info: var(--color-blue);
  --color-primary: var(--color-dark-blue);

  /* Neutral Colors */
  --color-text: #212529;
  --color-text-muted: #666;
  --color-text-light: #888;
  --color-text-inactive: #aaa;
  --color-border: #ccc;
  --color-border-light: #ddd;
  --color-bg-light: #f8f9fa;
  --color-bg-highlight: #fff9c4;

  /* Alert Background Colors */
  --color-alert-success-bg: #d4edda;
  --color-alert-success-border: #c3e6cb;
  --color-alert-success-text: #155724;
  --color-alert-warning-bg: #fff3cd;
  --color-alert-warning-border: #ffeeba;
  --color-alert-warning-text: #856404;
  --color-alert-danger-bg: #f8d7da;
  --color-alert-danger-border: #f5c6cb;
  --color-alert-danger-text: #721c24;
  --color-alert-info-bg: #d1ecf1;
  --color-alert-info-border: #bee5eb;
  --color-alert-info-text: #0c5460;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
  --shadow-highlight: 2px 2px 4px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   2. Reset & Base Styles
   ========================================================================== */

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

html {
  background: #f0f1f3;
}

body {
  margin: 0 auto;
  max-width: 600px;
  font-family: "SF Mono", "Menlo", "Monaco", "Consolas", "Liberation Mono", monospace;
  line-height: 1.5;
  padding: 1em;
  font-size: 16px;
  color: var(--color-text);
  background: #fff;
}

/* ==========================================================================
   3. Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p { margin-bottom: 1rem; }

ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.5em;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

small {
  font-size: 0.875rem;
}

/* Monospace (for budget displays) */
.mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* ==========================================================================
   4. Layout
   ========================================================================== */

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

.row {
  display: flex;
  flex-wrap: wrap;
}

.col { flex: 1 0 0%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

.hide-mobile { }

@media (max-width: 768px) {
  .hide-mobile { display: none; }
  .col-4, .col-6, .col-8 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .row {
    flex-direction: column;
  }
}

/* Budget Page Layout */

/* ==========================================================================
   5. Navigation
   ========================================================================== */

nav {
  margin-bottom: 1em;
  padding-bottom: 0;
  border-bottom: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav a, nav ul a {
  color: var(--color-text);
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 1em;
}

nav li {
  display: inline;
}

nav a {
  text-decoration: none;
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: bold;
}

.nav-link {
  color: var(--color-text);
}

.nav-link:hover {
  color: var(--color-dark-blue);
  text-decoration: none;
}

/* Mobile Navigation */
.nav-toggle {
  display: none;
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }
  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 1rem;
  }
  .nav-menu.active {
    display: flex;
  }
  .nav-item {
    margin: 0.5rem 0;
  }
}

/* ==========================================================================
   6. Forms
   ========================================================================== */

form {
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

input,
textarea,
select,
button {
  box-sizing: border-box;
  font: inherit;
  color: inherit;
  margin: 0;
  padding: 0.5em;
  border: 1px solid var(--color-border);
  background-color: #fff;
  line-height: 1.2;
  border-radius: 4px;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="password"],
select {
  padding: 0.5em;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  box-sizing: border-box;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  background-color: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: 0.25rem;
}

.form-select {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  background-color: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: 0.25rem;
}

.form-check {
  display: block;
  min-height: 1.5rem;
  margin-bottom: 0.5rem;
}

.form-check-input {
  margin-right: 0.5rem;
}

.form-check-label {
  display: inline-block;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-text {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.form-switch .form-check-input {
  appearance: none;
  width: 2em;
  height: 1em;
  background-color: var(--color-border);
  border-radius: 1em;
  position: relative;
  cursor: pointer;
  border: none;
  padding: 0;
  vertical-align: middle;
}

.form-switch .form-check-input::before {
  content: "";
  position: absolute;
  top: 0.1em;
  left: 0.1em;
  width: 0.8em;
  height: 0.8em;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.15s ease-in-out;
}

.form-switch .form-check-input:checked {
  background-color: var(--color-primary);
}

.form-switch .form-check-input:checked::before {
  transform: translateX(1em);
}

/* ==========================================================================
   7. Buttons
   ========================================================================== */

button {
  cursor: pointer;
}

.btn {
  display: inline-block;
  font-weight: 400;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
}

.btn:hover {
  opacity: 0.9;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-primary);
  border: 1px solid var(--color-primary);
  color: white;
}

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

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--color-border-light);
}

.btn-outline:hover {
  background-color: var(--color-bg-light);
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 0.5rem 1rem;
  font-size: 1.125rem;
}

.btn-danger {
  background-color: var(--color-error);
  border: 1px solid var(--color-error);
  color: white;
}

.btn-warning {
  background-color: var(--color-warning);
  border: 1px solid var(--color-warning);
  color: #212529;
}

.btn-outline-primary {
  background-color: transparent;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
}

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

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

.btn-outline-secondary:hover {
  background-color: var(--color-bg-light);
  color: var(--color-text);
}

.btn-outline-danger {
  background-color: transparent;
  border: 1px solid var(--color-error);
  color: var(--color-error);
}

.btn-outline-danger:hover {
  background-color: var(--color-error);
  color: white;
}

.btn-outline-success {
  background-color: transparent;
  border: 1px solid var(--color-success);
  color: var(--color-success);
}

.btn-outline-success:hover {
  background-color: var(--color-success);
  color: white;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-group {
  display: inline-flex;
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-radius: 0.25rem 0 0 0.25rem;
}

.btn-group .btn:last-child {
  border-radius: 0 0.25rem 0.25rem 0;
}

/* ==========================================================================
   8. Lists
   ========================================================================== */

.list-unstyled {
  list-style: none;
  padding-left: 0;
}

.list-group {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin-bottom: 1rem;
  border: 1px solid var(--color-border-light);
  border-radius: 0.25rem;
}

.list-group-flush {
  border: none;
  border-radius: 0;
}

.list-group-item {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--color-border-light);
  list-style: none;
}

.list-group-item:last-child {
  border-bottom: 0;
}

.list-group-flush .list-group-item {
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}

.list-group-item-action {
  color: var(--color-text);
  text-decoration: none;
}

.list-group-item-action:hover {
  background-color: var(--color-bg-light);
}

/* ==========================================================================
   8b. Tables
   ========================================================================== */

.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.table th,
.table td {
  padding: 0.75rem;
  border-top: 1px solid var(--color-border-light);
  text-align: left;
}

.table thead th {
  border-bottom: 2px solid var(--color-border);
  border-top: none;
}

.table-hover tbody tr:hover {
  background-color: var(--color-bg-light);
}

.table-responsive {
  display: block;
  width: 100%;
  overflow-x: auto;
}

/* ==========================================================================
   9. Alerts
   ========================================================================== */

.alert {
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.25rem;
}

.alert-success {
  color: var(--color-alert-success-text);
  background-color: var(--color-alert-success-bg);
  border-color: var(--color-alert-success-border);
}

.alert-warning {
  color: var(--color-alert-warning-text);
  background-color: var(--color-alert-warning-bg);
  border-color: var(--color-alert-warning-border);
}

.alert-danger {
  color: var(--color-alert-danger-text);
  background-color: var(--color-alert-danger-bg);
  border-color: var(--color-alert-danger-border);
}

.alert-info {
  color: var(--color-alert-info-text);
  background-color: var(--color-alert-info-bg);
  border-color: var(--color-alert-info-border);
}

.alert-secondary {
  color: #383d41;
  background-color: #e2e3e5;
  border-color: #d6d8db;
}

.alert-heading {
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* Inline warning box */
.warning-box {
  background-color: var(--color-alert-warning-bg);
  border: 1px solid #ffeaa7;
  padding: 1em;
  margin-bottom: 1em;
}

.warning-box h3 {
  margin-top: 0;
}

/* ==========================================================================
   10. Badges
   ========================================================================== */

.badge {
  display: inline-block;
  padding: 0.25em 0.5em;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0.25rem;
}

.bg-light {
  background-color: var(--color-bg-light);
}

.bg-secondary {
  background-color: var(--color-text-muted);
  color: white;
}

.bg-success {
  background-color: var(--color-success);
  color: white;
}

.bg-danger {
  background-color: var(--color-error);
  color: white;
}

/* ==========================================================================
   11. Budget Display
   ========================================================================== */

.budget-breakdown {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  margin: 1.5em 0;
  line-height: 1.8;
}

.budget-line {
  display: flex;
  align-items: baseline;
}

.budget-sign {
  display: inline-block;
  width: 2ch;
  text-align: right;
}

.budget-amount {
  display: inline-block;
  width: 5ch;
  text-align: right;
}

.budget-highlight {
  background-color: var(--color-bg-highlight);
  padding: 0.1em 0.4em;
  box-shadow: var(--shadow-highlight);
}

.budget-detail {
  margin-left: 8ch;
  color: var(--color-text-muted);
}

.budget-detail a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.budget-shortfall {
  margin-left: 8ch;
  color: var(--color-red);
  font-weight: bold;
}

.budget-divider {
  border-top: 1px solid var(--color-border);
  margin: 0.5em 0;
  width: 20em;
}

/* Priority borders */
.priority-1 {
  border-left: 4px solid var(--color-success);
}

.priority-2 {
  border-left: 4px solid var(--color-warning);
}

.priority-3 {
  border-left: 4px solid var(--color-info);
}

/* ==========================================================================
   12. History Map
   ========================================================================== */


/* ==========================================================================
   13. Status Indicators
   ========================================================================== */

.status-on-track {
  color: var(--color-success);
}

.status-slightly-behind {
  color: var(--color-warning);
}

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

/* ==========================================================================
   14. Footer
   ========================================================================== */

footer {
  margin-top: 3em;
  padding-top: 1em;
  font-size: 0.8rem;
}

/* ==========================================================================
   15. Utility Classes
   ========================================================================== */

/* Text Alignment */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-end { text-align: right; }

/* Text Colors */
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-error); }
.text-warning { color: var(--color-warning); }
.text-info { color: var(--color-info); }
.text-muted { color: var(--color-text-muted); }
.text-dark { color: var(--color-text); }
.text-inactive { color: var(--color-text-inactive); }

/* Display */
.d-flex { display: flex; }
.d-grid { display: grid; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-none { display: none; }

/* Flexbox */
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

/* Margins */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }
.me-3 { margin-right: 1rem; }

.ms-1 { margin-left: 0.25rem; }
.ms-2 { margin-left: 0.5rem; }
.ms-3 { margin-left: 1rem; }

/* Padding */
.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }

.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }

.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.pb-4 { padding-bottom: 1.5rem; }
.pt-4 { padding-top: 1.5rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

.px-3 { padding-left: 1rem; padding-right: 1rem; }

/* Width */
.w-100 { width: 100%; }

/* Height */
.h-100 { height: 100%; }

/* Borders */
.border { border: 1px solid var(--color-border-light); }
.border-top { border-top: 1px solid var(--color-border-light); }
.border-bottom { border-bottom: 1px solid var(--color-border-light); }
.border-secondary { border-color: var(--color-text-muted); }
.rounded { border-radius: 0.25rem; }

/* Visibility */
.visually-hidden,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Typography */
.small { font-size: 0.875rem; }

/* Spinners */
.spinner-border {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 0.25em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.2em;
}

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

.text-peach { color: var(--color-primary); }

/* ==========================================================================
   16. JS Toggle (Collapse)
   ========================================================================== */

.collapse {
  display: none;
}

.collapse.show {
  display: block;
}


