/* FinTracker — css/manage.css
 * Manage Categories + Manage Options (generic list manager, shared .cat-row styles).
 * Part of the styles.css split — see CLAUDE.md "Module map". Loaded via multiple
 * <link> tags in the same cascade order as the original single file. */

/* ============ Manage Categories ============ */
.cat-manage-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cat-row {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cat-row--disabled .cat-row__title,
.cat-row--disabled .cat-row__sub { opacity: 0.45; }
.cat-row--disabled .cat-row__icon { opacity: 0.45; }
.cat-row__top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}
.cat-row__icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cat-row__icon svg { width: 20px; height: 20px; }
.cat-row__icon img { width: 23px; height: 23px; object-fit: contain; }
.cat-row__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}
.cat-row__title { font-size: 0.9rem; font-weight: 700; color: var(--navy); }
.cat-row__sub { font-size: 0.76rem; font-weight: 500; color: var(--navy-soft); }
.cat-row__chevron {
  flex-shrink: 0;
  color: #c7ccd6;
  transition: transform 0.2s ease;
}
.cat-row.is-open .cat-row__chevron { transform: rotate(90deg); color: var(--green); }

/* Toggle switch */
.switch { position: relative; width: 42px; height: 25px; flex-shrink: 0; }
.switch__input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch__track {
  position: absolute; inset: 0;
  background: #dfe4ea;
  border-radius: 999px;
  transition: background 0.15s ease;
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.15s ease;
}
.switch__input:checked + .switch__track { background: var(--green); }
.switch__input:checked + .switch__track::after { transform: translateX(17px); }

.cat-row__panel {
  padding: 4px 14px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cat-row__panel[hidden] { display: none; }
.cat-row__field-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--navy-soft);
  margin: 10px 0 8px;
}
.cat-row__name-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--navy);
  background: #f7f8fa;
  margin-top: 10px;
}
.cat-row__name-input:focus { outline: none; border-color: var(--green); background: #fff; }
.cat-row__examples {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.86rem;
  color: var(--navy);
  background: #f7f8fa;
  resize: vertical;
  min-height: 56px;
}
.cat-row__examples:focus { outline: none; border-color: var(--green); background: #fff; }
.cat-row__manage-sub {
  width: 100%;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--navy);
  background: #f7f8fa;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.cat-row__delete {
  width: 100%;
  padding: 8px;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--red);
}

@media (min-width: 560px) {
  .app {
    min-height: auto;
    border-radius: 32px;
    box-shadow: 0 40px 80px -24px rgba(20, 30, 55, 0.28), 0 0 0 1px rgba(20, 30, 55, 0.05);
    overflow: hidden;
    padding-bottom: 0;
  }
  .app-main { flex: 0 1 auto; }
  .bottom-nav {
    position: static;
    max-width: none;
    margin: 0;
    border-radius: 0 0 32px 32px;
  }
}
