/* Catppuccin Mocha (default) */
:root {
  --base: #1e1e2e;
  --mantle: #181825;
  --crust: #11111b;
  --surface0: #313244;
  --surface1: #45475a;
  --surface2: #585b70;
  --overlay0: #6c7086;
  --overlay1: #7f849c;
  --text: #cdd6f4;
  --subtext0: #a6adc8;
  --subtext1: #bac2de;
  --blue: #89b4fa;
  --lavender: #b4befe;
  --sapphire: #74c7ec;
  --sky: #89dceb;
  --teal: #94e2d5;
  --green: #a6e3a1;
  --yellow: #f9e2af;
  --peach: #fab387;
  --maroon: #eba0ac;
  --red: #f38ba8;
  --mauve: #cba6f7;
  --pink: #f5c2e7;
  --flamingo: #f2cdcd;
  --rosewater: #f5e0dc;
}

/* Catppuccin Latte (light) */
[data-theme='latte'] {
  --base: #eff1f5;
  --mantle: #e6e9ef;
  --crust: #dce0e8;
  --surface0: #ccd0da;
  --surface1: #bcc0cc;
  --surface2: #acb0be;
  --overlay0: #9ca0b0;
  --overlay1: #8c8fa1;
  --text: #4c4f69;
  --subtext0: #6c6f85;
  --subtext1: #5c5f77;
  --blue: #1e66f5;
  --lavender: #7287fd;
  --sapphire: #209fb5;
  --sky: #04a5e5;
  --teal: #179299;
  --green: #40a02b;
  --yellow: #df8e1d;
  --peach: #fe640b;
  --maroon: #e64553;
  --red: #d20f39;
  --mauve: #8839ef;
  --pink: #ea76cb;
  --flamingo: #dd7878;
  --rosewater: #dc8a78;
}

/* Catppuccin Frappé (medium dark) */
[data-theme='frappe'] {
  --base: #303446;
  --mantle: #292c3c;
  --crust: #232634;
  --surface0: #414559;
  --surface1: #51576d;
  --surface2: #626880;
  --overlay0: #737994;
  --overlay1: #838ba7;
  --text: #c6d0f5;
  --subtext0: #a5adce;
  --subtext1: #b5bfe2;
  --blue: #8caaee;
  --lavender: #babbf1;
  --sapphire: #85c1dc;
  --sky: #99d1db;
  --teal: #81c8be;
  --green: #a6d189;
  --yellow: #e5c890;
  --peach: #ef9f76;
  --maroon: #ea999c;
  --red: #e78284;
  --mauve: #ca9ee6;
  --pink: #f4b8e4;
  --flamingo: #eebebe;
  --rosewater: #f2d5cf;
}

/* Catppuccin Macchiato (dark) */
[data-theme='macchiato'] {
  --base: #24273a;
  --mantle: #1e2030;
  --crust: #181926;
  --surface0: #363a4f;
  --surface1: #494d64;
  --surface2: #5b6078;
  --overlay0: #6e738d;
  --overlay1: #8087a2;
  --text: #cad3f5;
  --subtext0: #a5adcb;
  --subtext1: #b8c0e0;
  --blue: #8aadf4;
  --lavender: #b7bdf8;
  --sapphire: #7dc4e4;
  --sky: #91d7e3;
  --teal: #8bd5ca;
  --green: #a6da95;
  --yellow: #eed49f;
  --peach: #f5a97f;
  --maroon: #ee99a0;
  --red: #ed8796;
  --mauve: #c6a0f6;
  --pink: #f5bde6;
  --flamingo: #f0c6c6;
  --rosewater: #f4dbd6;
}

/* System: Latte in light mode, Mocha in dark mode */
[data-theme='system'] {
  --base: #eff1f5;
  --mantle: #e6e9ef;
  --crust: #dce0e8;
  --surface0: #ccd0da;
  --surface1: #bcc0cc;
  --surface2: #acb0be;
  --overlay0: #9ca0b0;
  --overlay1: #8c8fa1;
  --text: #4c4f69;
  --subtext0: #6c6f85;
  --subtext1: #5c5f77;
  --blue: #1e66f5;
  --lavender: #7287fd;
  --sapphire: #209fb5;
  --sky: #04a5e5;
  --teal: #179299;
  --green: #40a02b;
  --yellow: #df8e1d;
  --peach: #fe640b;
  --maroon: #e64553;
  --red: #d20f39;
  --mauve: #8839ef;
  --pink: #ea76cb;
  --flamingo: #dd7878;
  --rosewater: #dc8a78;
}
@media (prefers-color-scheme: dark) {
  [data-theme='system'] {
    --base: #1e1e2e;
    --mantle: #181825;
    --crust: #11111b;
    --surface0: #313244;
    --surface1: #45475a;
    --surface2: #585b70;
    --overlay0: #6c7086;
    --overlay1: #7f849c;
    --text: #cdd6f4;
    --subtext0: #a6adc8;
    --subtext1: #bac2de;
    --blue: #89b4fa;
    --lavender: #b4befe;
    --sapphire: #74c7ec;
    --sky: #89dceb;
    --teal: #94e2d5;
    --green: #a6e3a1;
    --yellow: #f9e2af;
    --peach: #fab387;
    --maroon: #eba0ac;
    --red: #f38ba8;
    --mauve: #cba6f7;
    --pink: #f5c2e7;
    --flamingo: #f2cdcd;
    --rosewater: #f5e0dc;
  }
}

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

body {
  background: var(--base);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Layout */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

nav {
  background: var(--mantle);
  border-bottom: 1px solid var(--surface0);
  padding: 0.75rem 0;
}
nav .container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
nav .brand {
  color: var(--mauve);
  font-weight: 700;
  font-size: 1.1rem;
}
nav a {
  color: var(--subtext1);
  font-size: 0.9rem;
}
nav a:hover {
  color: var(--text);
  text-decoration: none;
}
nav .nav-right {
  margin-left: auto;
  display: flex;
  gap: 1rem;
  align-items: center;
}
.status-badge {
  font-size: 0.75rem;
  color: var(--green);
  background: var(--surface0);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

main {
  padding: 2rem 0;
}

/* Forms */
.form-card {
  background: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: 8px;
  padding: 2rem;
  max-width: 480px;
  margin: 2rem auto;
}
.form-card h1 {
  font-size: 1.4rem;
  color: var(--mauve);
  margin-bottom: 0.5rem;
}
.form-card p {
  color: var(--subtext0);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.field {
  margin-bottom: 1.25rem;
}
.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--subtext1);
  margin-bottom: 0.35rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--surface0);
  border: 1px solid var(--surface1);
  border-radius: 6px;
  color: var(--text);
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--blue);
  outline-offset: -1px;
  border-color: transparent;
}
.field textarea {
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
}
.field .hint {
  font-size: 0.8rem;
  color: var(--overlay1);
  margin-top: 0.25rem;
}
.badge-sensitive {
  font-size: 0.7rem;
  background: var(--surface1);
  color: var(--yellow);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.badge-required {
  font-size: 0.7rem;
  background: var(--surface1);
  color: var(--red);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.error-banner {
  background: color-mix(in srgb, var(--red) 15%, var(--mantle));
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}
.success-banner {
  background: color-mix(in srgb, var(--green) 15%, var(--mantle));
  border: 1px solid var(--green);
  color: var(--green);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}
.btn-primary {
  background: var(--blue);
  color: var(--crust);
}
.btn-primary:hover {
  background: var(--sapphire);
  text-decoration: none;
}
.btn-secondary {
  background: var(--surface1);
  color: var(--text);
}
.btn-secondary:hover {
  background: var(--surface2);
  text-decoration: none;
}
.btn-danger {
  background: color-mix(in srgb, var(--red) 20%, var(--surface0));
  color: var(--red);
}

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.page-header h1 {
  font-size: 1.4rem;
  color: var(--text);
}

/* Cards / list items */
.card {
  background: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}
.card:hover {
  border-color: var(--surface1);
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.card-meta {
  font-size: 0.82rem;
  color: var(--subtext0);
  margin-top: 0.25rem;
}
.card-summary {
  font-size: 0.9rem;
  color: var(--subtext1);
  margin-top: 0.4rem;
}

.tag {
  display: inline-block;
  background: var(--surface0);
  color: var(--mauve);
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  font-size: 0.78rem;
  margin: 0.15rem 0.1rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--subtext0);
}
.empty-state h2 {
  color: var(--overlay1);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

/* Detail view */
.detail-section {
  margin-bottom: 2rem;
}
.detail-section h2 {
  font-size: 1rem;
  color: var(--subtext1);
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--surface0);
  padding-bottom: 0.4rem;
}
.detail-row {
  display: flex;
  gap: 1rem;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.detail-label {
  color: var(--subtext0);
  min-width: 140px;
  flex-shrink: 0;
}
.detail-value {
  color: var(--text);
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
}
.stat-card .stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue);
}
.stat-card .stat-label {
  font-size: 0.82rem;
  color: var(--subtext0);
  margin-top: 0.25rem;
}

/* Responsive */
@media (max-width: 600px) {
  .form-card {
    margin: 1rem;
    padding: 1.25rem;
  }
  nav .container {
    gap: 0.75rem;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
